git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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 = ();
Previous: Junio C HamanoNext: Jeff King
Message 8 of 11 in “clone: test the new HEAD detection logic”
  1. 5/5 clone: test the new HEAD detection logicJunio C Hamano, Nov 30, 2008
  2. 4/5 upload-pack: implement protocol extension "symbolic-ref"Junio C Hamano, Nov 30, 2008
  3. 3/5 clone: find the current branch more explicitlyJunio C Hamano, Nov 30, 2008
  4. 2/5 get_remote_heads(): do not assume that the conversation is one-wayJunio C Hamano, Nov 30, 2008
  5. 1/5 upload-pack.c: refactor receive_needs()Junio C Hamano, Nov 30, 2008
  6. 0/5 Detecting HEAD more reliably while cloningJunio C Hamano, Nov 30, 2008
  7. Junio C HamanoNov 30, 2008
  8. Junio C HamanoDec 1, 2008
  9. Jeff KingNov 30, 2008
  10. Jeff KingNov 30, 2008
  11. Junio C HamanoDec 1, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.