Re: [PATCH] git-format-patch: Don't number patches when there's only one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Schindelin wrote:
Hi,

On Mon, 22 Oct 2007, Andreas Ericsson wrote:

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


Because 23498~12 != 23498~12..HEAD to git rev-list, but it is to
git-format-patch, meaning I'll have to duplicate the logic in every script that's supposed to use it or risk introducing a third way of specifying a list of revisions.

	[...]

	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.


Semantics could be equally clear for --numbered-if-multiple.

--
Andreas Ericsson                   andreas.ericsson@xxxxxx
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux