[TYPO3-core] Gerrit Workflow with changing patchsets

Peter Niederlag typo3-list at niekom.de
Thu Jul 28 10:05:40 CEST 2011


Am 28.07.2011 09:37, schrieb Nicolas de Haen:
> Hi Peter,
>  > bascily I think you should have two branches, one for each
>  > change-request. So all you would have to do is:
>  >
>  > * git checkout <branch-cr-two>
>  > * git rebase <branch-cr-one>
>  > * # git push <branch-cr-two>
> Do I need to create the branches on gerrit too?

NO! but you can create any branch local. IMO it is even advisable 
sometimes to have a loval branch per change request, if you keep working 
on them, want to monitor them, or one change request depends on another one.

> Or can I push from a local branch to origin master?

params for push are <remotename> <localsrcref>:<remotetargetref>

// for example
$ git push origin localscoolshit:refs/for/TYPO3_4-5

> What I do to modify an existing changeset is basically this:
> git fetch git://git.typo3.org/TYPO3v4/Extensions/extension_builder
> refs/changes/46/3246/1
> git co FETCH_HEAD
> (currently on no branch)
> -- make changes --
> git add .
> git ci --amend
> git push origin HEAD:refs/for/46/3246
> Could you describe the correct steps?
> (I promise to update the Wiki then...)
> ;-)

Well, some other folks around probably have more experience on stuff 
like this. I'll give a try "by theory". ;)


# keep this branch as local topic branch for later referal
git checkout -b <topic-branch-one>

# create a new topic branch, which depends on this one
git checkout -b <topic-branch-two>

# now we have tow topic branches on the same commit
# we add something on <topic-branch-two>
# hack, commit, push <topic-branch-two>

# <topic-branch-one> was updated meanwhile
# we need to make our local branch reflect that updated state
git checkout <topic-branch-one>
# fetch latest change
git fetch git://git.typo3.org/TYPO3v4/Extensions/extension_builder 
# reset --hard to reflect the new state
git reset --hard FETCH_HEAD

# update <topic-branch-two>
git checkout <topic-branch-two>
git rebase -i <topic-branch-one>

This is untested, but should work. You could also cherry-pick, apply 
manual diffs... I guess there are numerous ways...


Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *

More information about the TYPO3-team-core mailing list