[Kde-scm-interest] [PATCH] scripty

Thiago Macieira thiago at kde.org
Mon Jun 1 19:05:31 CEST 2009

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 
               useful only for HEAD, FETCH_HEAD, ORIG_HEAD and 

            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.

>> >+          git)
>> >+            git commit -a $SVNQUIETFLAG -m "SVN_SILENT made messages
>> > (.desktop file)" +            if ! git push > /dev/null; then
>> >+              echo "Need to update $i"
>> >+              git pull $SVNQUIETFLAG
>> >+              if ! git push; then
>> >+                echo "ERROR: commiting .desktop files failed for
>> > module $i!" +                git reset --hard $SVNQUIETFLAG origin +
>> >              fi
>> >+            fi
>> >+            ;;
>> I recommend pull before commit, since that will not create merge
>> commits. If pull fails, it's because the update would touch one of the
>> modified files. Note you have a commit above, which breaks this logic:
>> I recommend you do the same thing in both:
>> 	git pull && git commit -a -m "......" || error out
>all right...

Maybe even:

	git pull && git commit -a -m "message" && git push || error

  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-scm-interest/attachments/20090601/ab0fb46c/attachment.sig 

More information about the Kde-scm-interest mailing list