[Kde-scm-interest] [PATCH] scripty
Chani
chanika at gmail.com
Mon Jun 1 18:39:43 CEST 2009
On June 1, 2009 00:18:55 Thiago Macieira wrote:
> Chani wrote:
> >+ if test "$vcs" = "git"; then
> >+ git fetch
> >+ branch=`get_git_branch $modname`
> >+ if ! git branch | cut -c3- | grep -q "^$branch$"; then
>
> Use git symbolic-ref HEAD to get the current branch name. The result will
> be refs/heads/$branch.
>
> Alternatively, just run the command below anyway, which will fail if the
> branch already exists.
>
> >+ 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?
>
> >+ ;;
> >+ *)
> >+ echo "ERROR: unexpected VCS type?!"
>
> Add: exit 1
> Or continue or whatever will skip this module.
right, thanks.
>
> >+ if ! git checkout $SVNQUIETFLAG $branch; then
> >+ echo "ERROR: failed to switch to branch $branch for module
> > $modname." + exit 1 #FIXME I'd rather gracefully skip this
> > module. but how? + #perhaps I could filter $releases.
> > findfiles could be trouble though. + fi
> >+ git pull $SVNQUIETFLAG || echo "ERROR: module $i was not
> > correctly updated" + ;;
>
> Ok, sorry my ignorance but why do the NO_INITIAL_CLEANUP and NOUPDATE
flags
> exist in the first place?
>
> Under what conditions should they be used?
no clue. but I did take advantage of NO_INITIAL_CLEANUP while testing.
>
> Also, we've already done fetch & reset. There's no need to pull again here
> (it'll hit the network and will do little good).
yes, thanks, forgot to delete that.
>
> >+ 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...
>
> And again $branch missing in the reset.
>
> >+ git-test)
> >+ echo
> > "git at gitorious.org:scripty-with-git/git-test.git"
> > + ;;
>
> Hint: add kde-qt.git too, along with qt.git branches master and 4.5.
> You'll see branch the mistakes when doing that.
>
> Scripty doesn't commit to qt-copy, so it's not a problem.
--
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/35f675fd/attachment.sig
More information about the Kde-scm-interest
mailing list