[Kde-scm-interest] [PATCH] scripty
Chani
chanika at gmail.com
Mon Jun 1 19:22:54 CEST 2009
On June 1, 2009 10:05:31 Thiago Macieira wrote:
> Chani wrote:
> >> >+ git branch --track $branch origin/$branch
> >> >
> >> >+ git)
> >> >+ git clean -dfx $SVNQUIETFLAG
> >> >+ git reset --hard $SVNQUIETFLAG origin
> >>
> >> Doesn't this require origin/$branch here?
> >
> >oh, does it default to "master" without a branch? I thought it'd default
> > to the current branch. thing is, I can't be sure what branch I'm on at
> > this point (without asking git)... afaik I have to get everything clean
> > before I can checkout the right branch?
>
> From man git-rev-parse:
> 1. if $GIT_DIR/<name> exists, that is what you mean (this is
> usually
> useful only for HEAD, FETCH_HEAD, ORIG_HEAD and
> MERGE_HEAD);
>
> 2. otherwise, $GIT_DIR/refs/<name> if exists;
>
> 3. otherwise, $GIT_DIR/refs/tags/<name> if exists;
>
> 4. otherwise, $GIT_DIR/refs/heads/<name> if exists;
>
> 5. otherwise, $GIT_DIR/refs/remotes/<name> if exists;
>
> 6. otherwise, $GIT_DIR/refs/remotes/<name>/HEAD if exists.
>
> So in this case "origin" is simply refs/remotes/origin/HEAD, which is one
> single branch -- usually origin/master.
>
> The feature you're looking for (the upstream branch this branch tracks) is
> not yet implemented, besides for "git pull" and reading the config file.
>
> Yes, you should clean up before doing anything else.
so... hrm.
git reset doesn't change what local branch I'm on, does it? it resets that
branch to be all clean? so I have to make sure I reset it to the right
branch... eew...
although since we're about to checkout a different branch, maybe commits on
that other branch don't matter. scripty itself will try to undo its commits if
it fails to push, anyways.
so I could find out what branch I'm on and reset that, or I could do the reset
after the checkout, or I could just be lazy and not reset.
--
This message brought to you by eevil bananas and the number 3.
www.chani3.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-scm-interest/attachments/20090601/1d3377e7/attachment.sig
More information about the Kde-scm-interest
mailing list