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

Re: [PATCH 1/2] git-svn.perl: perform deletions before anything else

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 9, 2012, 20:08 UTC
Message-ID
<7vzkcrvkfa.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1328813725-16638-1-git-send-email-stevenrwalter@gmail.com>
Steven Walter <stevenrwalter@gmail.com> writes:
> -	my %o = ( D => 1, R => 0, C => -1, A => 3, M => 3, T => 3 );
> +	my %o = ( D => -2, R => 0, C => -1, A => 3, M => 3, T => 3 );

I know this code arrangement dates back to cf52b8f (git-svn: fix several corner-case and rare bugs with 'commit', 2006-02-20), but somehow I find it extremely hard to follow. The absolute values do not matter (this is only used to sort the classes of operations), and the fact that A/M/T shares the same value does not help a stable sort result (as it is used as a key to sort {} that is not given any key other than $o{$ab->{chg}} to tie-break). I suspect that writing it this way

	my %o = (D => 0, C => 1, R => 2, A => 3, M => 4, T => 5)
or even
	my $ord = 0;
	my %o = map { $_ => $ord++ } qw(D C R A M T);
would make it much easier to follow.
Previous: Steven WalterNext: Steven Walter
Message 3 of 17 in “git-svn.perl: perform deletions before anything else”
  1. 1/2 git-svn.perl: perform deletions before anything elseSteven Walter, Feb 9, 2012
  2. 2/2 git-svn.perl: fix a false-positive in the "already exists" testSteven Walter, Feb 9, 2012
  3. Junio C HamanoFeb 9, 2012
  4. Steven WalterFeb 9, 2012
  5. 1/2 git-svn.perl: perform deletions before anything elseSteven Walter, Feb 9, 2012
  6. Eric WongFeb 12, 2012
  7. Steven WalterFeb 12, 2012
  8. Eric WongFeb 12, 2012
  9. Steven WalterFeb 15, 2012
  10. Eric WongFeb 19, 2012
  11. git-svn.perl: fix a false-positive in the "already exists" testSteven Walter, Feb 20, 2012
  12. Eric WongFeb 22, 2012
  13. Junio C HamanoFeb 22, 2012
  14. Steven WalterFeb 22, 2012
  15. Junio C HamanoFeb 22, 2012
  16. Steven WalterFeb 23, 2012
  17. Thomas RastFeb 9, 2012

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.