threads / patch / 18555

patch, 2 partsAdd feature release instructions to gitworkflows man page

Subject: [PATCH 2/2] Add feature release instructions to gitworkflows man page

## tl;dr

7 messages between Mar 26, 2009 and Mar 26, 2009. Diffs are folded; open one to read it.

replies: 6people: 2as markdown or json

rocketraman@fastmail.fm· Mar 26, 2009, 01:56 UTC · lore

[PATCH 1/2] Add feature release instructions to MaintNotes addendum

From: Raman Gupta <raman@rocketraman.com>

Based on a mailing list discussion, add the operations for creating a feature release.

Signed-off-by: Raman Gupta <raman@rocketraman.com>
---
 Documentation/howto/maintain-git.txt |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
Show changes to Documentation/howto/maintain-git.txt +29 −0
diff --git a/Documentation/howto/maintain-git.txt b/Documentation/howto/maintain-git.txt
index 4357e26..f6ee0c5 100644
--- a/Documentation/howto/maintain-git.txt
+++ b/Documentation/howto/maintain-git.txt
@@ -244,6 +244,35 @@ by doing the following:
    repo.or.cz
 
 
+A feature release of git is made by tagging 'master' with a tag
+matching vX.Y.Z, where X.Y.Z is the feature release version.
+
+ - Optionally, track the current 'maint' branch to support
+   new releases for the older codebase if necessary.
+
+     $ git branch maint-X.Y.(Z-1) maint
+
+ - The 'maint' branch is updated to the new release.
+
+     $ git checkout maint
+     $ git merge master
+
+   This is equivalent to deleting maint and recreating it from
+   master, but it preserves the maint reflog.
+
+ - The 'next' branch may be rebuilt from the tip of 'master'
+   using the surviving topics on 'next'.
+
+     $ git branch -f next master
+
+   (Again, this approach preserves the reflog and per-branch
+   configuration of 'next')
+
+     $ git merge ai/topic_in_next1
+     $ git merge ai/topic_in_next2
+     ...
+
+
 Some observations to be made.
 
  * Each topic is tested individually, and also together with
-- 
1.6.2
rocketraman@fastmail.fm· Mar 26, 2009, 01:56 UTC · re: rocketraman@fastmail.fm · lore
From: Raman Gupta <raman@rocketraman.com>

Based on a mailing list discussion, add a description of the workflow, and associated commands, for creating a feature release.

Signed-off-by: Raman Gupta <raman@rocketraman.com>
---
 Documentation/gitworkflows.txt |   69 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 69 insertions(+), 0 deletions(-)
Show changes to Documentation/gitworkflows.txt +69 −0
diff --git a/Documentation/gitworkflows.txt b/Documentation/gitworkflows.txt
index 2b021e3..1796878 100644
--- a/Documentation/gitworkflows.txt
+++ b/Documentation/gitworkflows.txt
@@ -348,6 +348,75 @@ in patches to figure out the merge base.  See linkgit:git-am[1] for
 other options.
 
 
+RELEASE WORKFLOW
+----------------
+
+The maintainer may use the following release workflow:
+
+He first tags the tip of 'master' with a release tag, then he updates
+the 'maint' branch to the current tip of 'master' for managing future
+maintenance fixes on the current release, and lastly he optionally
+rebuilds 'next' from the tip of 'master'.
+
+
+Release Tagging
+~~~~~~~~~~~~~~~
+
+The new feature release is tagged on 'master' with a tag matching
+vX.Y.Z, where X.Y.Z is the new feature release version.
+
+.Release tagging
+[caption="Recipe: "]
+==========================================
+`git tag -s -m GIT "vX.Y.Z" vX.Y.Z`
+==========================================
+
+
+Maintenance branch update
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The current maintenance branch is optionally tracked with the older
+release version number to allow for further maintenance releases on
+the older codebase.
+
+.Track maint
+[caption="Recipe: "]
+=====================================
+`git branch maint-X.Y.(Z-1) maint`
+=====================================
+
+'maint' is now updated to the new release code so that maintenance
+fixes can be merged for the current version.
+
+.Update maint to new release
+[caption="Recipe: "]
+=====================================
+* `git checkout maint`
+* `git merge master`
+=====================================
+
+This is equivalent to deleting maint and recreating it from master,
+but it preserves the maint reflog.
+
+Update next branch
+~~~~~~~~~~~~~~~~~~
+
+The 'next' branch may be rebuilt from the tip of 'master' using the
+surviving topics on 'next'.
+
+This step is optional. If it is done by the maintainer, then a public
+announcement will be made indicating that 'next' was rebased.
+
+.Update maint to new release
+[caption="Recipe: "]
+=====================================
+* `git branch -f next master`
+* `git merge ai/topic_in_next1`
+* `git merge ai/topic_in_next2`
+* ...
+=====================================
+
+
 SEE ALSO
 --------
 linkgit:gittutorial[7],
-- 
1.6.2
Junio C Hamano· Mar 26, 2009, 06:48 UTC · re: rocketraman@fastmail.fm · lore

Re: [PATCH 2/2] Add feature release instructions to gitworkflows man page

rocketraman@fastmail.fm writes:
Show 11 quoted lines
> +Release Tagging
> +~~~~~~~~~~~~~~~
> +
> +The new feature release is tagged on 'master' with a tag matching
> +vX.Y.Z, where X.Y.Z is the new feature release version.
> +
> +.Release tagging
> +[caption="Recipe: "]
> +==========================================
> +`git tag -s -m GIT "vX.Y.Z" vX.Y.Z`
> +==========================================
I actually always do:
	git tag -s -m "GIT X.Y.Z" vX.Y.Z master

The argument to -m in your descriptoin is incorrectly quoted, and has an extra v. I also spell out 'master' to avoid mistakes, and I would be happy to encourage others to follow it.

Show 12 quoted lines
> +Maintenance branch update
> +~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +The current maintenance branch is optionally tracked with the older
> +release version number to allow for further maintenance releases on
> +the older codebase.
> +
> +.Track maint
> +[caption="Recipe: "]
> +=====================================
> +`git branch maint-X.Y.(Z-1) maint`
> +=====================================

This creates maint-X.Y.(Z-1) from maint, but calling this step "track maint" entirely misses the point.

When people use the word "track", the intention is that they intend to merge subsequent changes to the original branch (in this case, 'maint') to the new branch ('maint-X.Y.(Z-1)') from time to time.

That is exactly opposite to what I create maint-X.Y.(Z-1) branch for. This new "branch to maintain an older codebase" will *never* merge from 'maint' after it forks.

Show 8 quoted lines
> +Update next branch
> +~~~~~~~~~~~~~~~~~~
> +
> +The 'next' branch may be rebuilt from the tip of 'master' using the
> +surviving topics on 'next'.
> +
> +This step is optional. If it is done by the maintainer, then a public
> +announcement will be made indicating that 'next' was rebased.
The wording I use is more like 'rewound and rebuilt'.
Raman Gupta· Mar 26, 2009, 14:35 UTC · re: Junio C Hamano · lore

Re: [PATCH 2/2] Add feature release instructions to gitworkflows man page

Junio C Hamano wrote:
Show 21 quoted lines
> rocketraman@fastmail.fm writes:
> 
>> +Release Tagging
>> +~~~~~~~~~~~~~~~
>> +
>> +The new feature release is tagged on 'master' with a tag matching
>> +vX.Y.Z, where X.Y.Z is the new feature release version.
>> +
>> +.Release tagging
>> +[caption="Recipe: "]
>> +==========================================
>> +`git tag -s -m GIT "vX.Y.Z" vX.Y.Z`
>> +==========================================
> 
> I actually always do:
> 
> 	git tag -s -m "GIT X.Y.Z" vX.Y.Z master
> 
> The argument to -m in your descriptoin is incorrectly quoted, and has an
> extra v.  I also spell out 'master' to avoid mistakes, and I would be
> happy to encourage others to follow it.
Fixed.
Show 23 quoted lines
>> +Maintenance branch update
>> +~~~~~~~~~~~~~~~~~~~~~~~~~
>> +
>> +The current maintenance branch is optionally tracked with the older
>> +release version number to allow for further maintenance releases on
>> +the older codebase.
>> +
>> +.Track maint
>> +[caption="Recipe: "]
>> +=====================================
>> +`git branch maint-X.Y.(Z-1) maint`
>> +=====================================
> 
> This creates maint-X.Y.(Z-1) from maint, but calling this step "track
> maint" entirely misses the point.
> 
> When people use the word "track", the intention is that they intend to
> merge subsequent changes to the original branch (in this case, 'maint') to
> the new branch ('maint-X.Y.(Z-1)') from time to time.
> 
> That is exactly opposite to what I create maint-X.Y.(Z-1) branch for.
> This new "branch to maintain an older codebase" will *never* merge from
> 'maint' after it forks.

Yeah, I originally had written "Copy maint" but copy seemed to be more subversion-speak rather than git-speak so I changed it. However it does seem to accurately describe the operation. Would "Copy maint" be acceptable terminology?

Show 10 quoted lines
>> +Update next branch
>> +~~~~~~~~~~~~~~~~~~
>> +
>> +The 'next' branch may be rebuilt from the tip of 'master' using the
>> +surviving topics on 'next'.
>> +
>> +This step is optional. If it is done by the maintainer, then a public
>> +announcement will be made indicating that 'next' was rebased.
> 
> The wording I use is more like 'rewound and rebuilt'.
Fixed.

Cheers, Raman

Raman Gupta· Mar 26, 2009, 13:51 UTC · lore

Re: [PATCH 1/2] Add feature release instructions to MaintNotes addendum

Nanako Shiraishi wrote:
Show 13 quoted lines
> Quoting rocketraman@fastmail.fm:
> 
>> + - The 'maint' branch is updated to the new release.
>> +
>> +     $ git checkout maint
>> +     $ git merge master
>> +
>> +   This is equivalent to deleting maint and recreating it from
>> +   master, but it preserves the maint reflog.
> 
> After giving a recipe that is better than an alternative, what's
> the point of describing an inferior alternative as "equivalent",
> when it is obviously not "equivalent"?
Is this better:

The resulting maint tree is equivalent to deleting maint and recreating it from the tip of master, but merging from master preserves the maint reflog.

Cheers, Raman

Junio C Hamano· Mar 26, 2009, 20:28 UTC · re: Raman Gupta · lore

Re: [PATCH 1/2] Add feature release instructions to MaintNotes addendum

Raman Gupta <rocketraman@fastmail.fm> writes:
Show 20 quoted lines
> Nanako Shiraishi wrote:
>> Quoting rocketraman@fastmail.fm:
>> 
>>> + - The 'maint' branch is updated to the new release.
>>> +
>>> +     $ git checkout maint
>>> +     $ git merge master
>>> +
>>> +   This is equivalent to deleting maint and recreating it from
>>> +   master, but it preserves the maint reflog.
>> 
>> After giving a recipe that is better than an alternative, what's
>> the point of describing an inferior alternative as "equivalent",
>> when it is obviously not "equivalent"?
>
> Is this better:
>
> The resulting maint tree is equivalent to deleting maint and
> recreating it from the tip of master, but merging from master
> preserves the maint reflog.

It is unclear what you are trying to explain with these two (in your original) or three (your rewrite) lines. As an explanation for the two command sequence, I would expect to see:

    "This merges the tip of the master into maint".

But that is literally what the command sequence does, so it goes without saying.

If there is anything that needs to be said further, I think it is not how delete-then-recreate is inappropriate (I do not think it is even worth teaching). But you may want to explain the reason _why_ maint gets this update from master. I thought the explanation "... is updated to the new release" already covers that motivation, but if you want to make the description really novice-friendly, you _could_ say something like:

    Now a new release X.Y.Z is out, the 'maint' branch will be used to
    manage the fixes to it.  The branch used to be used for managing the
    fixes to X.Y.(Z-1), and does not have any feature development that
    happened between X.Y.(Z-1) and X.Y.Z.  Because these changes are
    contained in the 'master' branch, we can merge 'master' to 'maint' to
    have the latter have them, which prepares it to be used for managing
    the fixes to X.Y.Z.

I personally would not want to see somebody who needs the above to be explained to take over git maintenance after I get hit by a wayward bus, by the way ;-)

Raman Gupta· Mar 26, 2009, 21:37 UTC · re: Junio C Hamano · lore

Re: [PATCH 1/2] Add feature release instructions to MaintNotes addendum

Junio C Hamano wrote:
Show 29 quoted lines
> Raman Gupta <rocketraman@fastmail.fm> writes:
> 
>> Nanako Shiraishi wrote:
>>> Quoting rocketraman@fastmail.fm:
>>>
>>>> + - The 'maint' branch is updated to the new release.
>>>> +
>>>> +     $ git checkout maint
>>>> +     $ git merge master
>>>> +
>>>> +   This is equivalent to deleting maint and recreating it from
>>>> +   master, but it preserves the maint reflog.
>>> After giving a recipe that is better than an alternative, what's
>>> the point of describing an inferior alternative as "equivalent",
>>> when it is obviously not "equivalent"?
>> Is this better:
>>
>> The resulting maint tree is equivalent to deleting maint and
>> recreating it from the tip of master, but merging from master
>> preserves the maint reflog.
> 
> It is unclear what you are trying to explain with these two (in your
> original) or three (your rewrite) lines.  As an explanation for the two
> command sequence, I would expect to see:
> 
>     "This merges the tip of the master into maint".
> 
> But that is literally what the command sequence does, so it goes without
> saying.

Let me see if I can explain why I think the extra verbiage, at least in some form, is useful...

It is my understanding that the _goal_ in this case is for the maint tree to match the master tree (so that the maint tree matches the new feature release). The "obvious" way to do that, at least for less experienced folks, is to delete maint, and recreate it from the tip of master (or from the feature release tag which should be the same commit).

In this particular case, because and only because of the semantics of the maint and master branch i.e. we know that master already contains everything that maint does, merging from master to maint makes the trees equivalent, while *also* maintaining the reflog. However, someone less familiar with the semantics of the maint and master branches may not draw this conclusion automatically.

BTW, would:
git branch -f maint master
be another way of doing this?
Show 18 quoted lines
> If there is anything that needs to be said further, I think it is not how
> delete-then-recreate is inappropriate (I do not think it is even worth
> teaching).  But you may want to explain the reason _why_ maint gets this
> update from master.  I thought the explanation "... is updated to the new
> release" already covers that motivation, but if you want to make the
> description really novice-friendly, you _could_ say something like:
> 
>     Now a new release X.Y.Z is out, the 'maint' branch will be used to
>     manage the fixes to it.  The branch used to be used for managing the
>     fixes to X.Y.(Z-1), and does not have any feature development that
>     happened between X.Y.(Z-1) and X.Y.Z.  Because these changes are
>     contained in the 'master' branch, we can merge 'master' to 'maint' to
>     have the latter have them, which prepares it to be used for managing
>     the fixes to X.Y.Z.
> 
> I personally would not want to see somebody who needs the above to be
> explained to take over git maintenance after I get hit by a wayward bus,
> by the way ;-)

:) Very true, but there are lots of people out there who are trying to understand and use git, and when they come across documentation like this they rightfully think "hey if this works for the git.git guys, it would probably be a pretty good starting point for me as well!". I know I did. So a bit of explanation may be appropriate, even though its not relevant for your intended audience. On the other hand, maybe the newbie-level explanation can be skipped here, and instead be put into gitworkflows(7). For my next patch iteration, I'll assume that's what you want unless you tell me otherwise.

Cheers, Raman

← back to recent threads