Re: [PATCH] git-format-patch: Don't number patches when there's only one
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 22, 2007, 10:22 UTC
- Message-ID
- <Pine.LNX.4.64.0710221119300.25221@racer.site>
- In-Reply-To
- <471C77F0.5050701@op5.se>
Hi,
On Mon, 22 Oct 2007, Andreas Ericsson wrote:
Show 15 quoted lines
> Johannes Schindelin wrote: > > > On Sun, 21 Oct 2007, Andreas Ericsson wrote: > > > > > [PATCH 1/1] looks a bit silly, and automagically handling this in > > > git-format-patch makes some scripting around it a lot more pleasant. > > > > I think you should not use "-n" if you do not want to have the > > numbers. > > This stems from creating scripts around it where I only want to see the > numbers if there is more than a single patch. Currently I can't do that > without running git-format-patch twice or re-implementing the revision > parsing machinery to count revisions prior to passing arguments to > format-patch.
Why not have something as simple as
numbered= test $(git rev-list $options | wc -l) -gt 1 && numbered=-n
[...]
git format-patch $numbered $options
At the moment, the semantics of "--numbered" is really clear and precise. And I really like that. It makes for less surprises.
Ciao, Dscho