commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Maisonobe <...@spaceroots.org>
Subject Re: [Math] Feature development model (Was: big batch of commits coming)
Date Wed, 06 Jan 2016 17:42:06 GMT
Le 06/01/2016 15:56, Gilles a écrit :
> Hi.
> 
> I've reread this article (which IIRC was advertised on this list some
> time ago):
>   http://nvie.com/posts/a-successful-git-branching-model/
> 
> It is quite clear and I think that it would easy to get used to.

Yes, it is quite a good model.

> Unless there are shortcomings that would prevent its use with the CM
> repository, I propose that we adopt it officially, and assume its
> nomenclature in order to eventually develop scripts similar to
> what is mentioned below.

That would be fine with me. One should however be aware that we
cannot delete branches in Apache git repository anymore (at least
I think this is something that is now enforced). The reason is
that history should never be lost, or rewritten. So everything
that hits the repository remains there.

Considering this, having very short lived hotfix branches may
prove unpractical. I would not like on the other hand having
such short lived branches fly around outside of Apache infrastructure
(like github or anything), as these would defeat the purpose of
preserving history.

However, using more topic branches seems good to me. This is what
was done for the field-doe (and the branch is still there).

best regards,
Luc

> 
> 
> Best regards,
> Gilles
> 
> On Wed, 6 Jan 2016 14:49:09 +0100, Luc Maisonobe wrote:
>> Hi all,
>>
>> As discussed a few weeks ago, I ported the new field-based ode feature
>> from MATH_3_X to master. I was finally able to do that without losing
>> the about hundred commits history, by replaying them with some scripting.
>>
>> In case this is of interest for some of you, here is how I managed to
>> do that.
>>
>> First, I had to find the commit lists in the MATH_3_X branch that
>> were of interest, concentrating only on the real code change commits
>> (i.e. ignoring the merge commits that occurred two or three time
>> between the topic branch field-ode and MATH_3_X branch). This was
>> done by identifying a start and an end commit and listing the
>> intermediate ones with the following command:
>>
>> git rev-list ^4685d03~1 b5276e9 --author=Luc --max-parents=1 --reverse
>>
>> I put this list in a file for later looping over this.
>>
>> Then I wrote a small script that extracted from one commit identifier
>> the commit message in one temporary file, and the diff in another
>> temporary file, with all math3 strings replaced with math4. The
>> diff was then applied, spurious .orig and .rej files eliminated, and
>> the commit performed with the same message as the original commit. Here
>> are the few commands:
>>
>>   git show --pretty=format:"%s%n%n%b" --no-patch $1 \
>>        > $tmpdir/commit-message
>>   git show --pretty=format:"" $1 | sed 's,math3,math4,g' \
>>       > $tmpdir/commit-patch
>>
>>   patch -p1 < $tmpdir/commit-patch && |
>>     find . -name '*.orig' -exec rm {} \; \
>>         -o -name '*.rej'  -exec rm {} \; && \
>>     git add . && \
>>     git commit -F $tmpdir/commit-message
>>
>> It worked quite well, with only a few glitches that forced me to
>> interrupt the loop, remove a few commits, correct the command, and
>> restart the loop.
>>
>> After that, I replayed a number of additional commits picked up
>> individually one at a time, for commits that occurred more recently
>> than the range before and were interspersed with other commits in
>> the MATH_3_X branch. So at the end, I had 101 commits.
>>
>> All of this was done on a local tmp branch, so I coud roll back and
>> restart from scratch easily if anything went wrong. When I was certain
>> that this tmp branch was complete, I merged it into master.
>>
>> You will see the last step in a few minutes, with a git push that will
>> update master with the 101 commits that are in the pipe. I'm sorry for
>> the noise.
>>
>> At the end, we will have a master branch with the same feature as the
>> MATH_3_X branch, and a full history of the development of this feature.
>>
>> best regards,
>> Luc
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message