Re: [PATCH 0/5] Detecting HEAD more reliably while cloning
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 1, 2008, 02:54 UTC
- Message-ID
- <7vzljgsiyn.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <7vabbhttq0.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
> You may have noticed that the new git-send-email reversed the order of six > patch files (one cover and five patches) I gave from the command line. > Please consider this series as a bug report ;-) > > I think the bug is that "pop @ARGV" should read "shift @ARGV" or something > silly and trivial like that, but it is getting late, so I won't debug > tonight.
Perhaps this is a good enough fix? Very lightly tested.
-- >8 -- send-email: do not reverse the command line arguments
The loop picks elements from @ARGV one by one, sifts them into arguments meant for format-patch and the script itself, and pushes them to @files and @rev_list_opts arrays. Pick elements from @ARGV starting at the beginning using shift, instead of at the end using pop, as push appends them to the end of the array.
Signed-off-by: Junio C Hamano <gitster@pobox.com> --- git-send-email.perl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git c/git-send-email.perl w/git-send-email.perl index 7508f8f..45beb9c 100755 --- c/git-send-email.perl +++ w/git-send-email.perl @@ -421,7 +421,7 @@ EOF # Now that all the defaults are set, process the rest of the command line # arguments and collect up the files that need to be processed. my @rev_list_opts; -while (my $f = pop @ARGV) { +while (defined(my $f = shift @ARGV)) { if ($f eq "--") { push @rev_list_opts, "--", @ARGV; @ARGV = ();