Thread (10 messages) 10 messages, 3 authors, 2016-06-15

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

flat view

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:01

Possibly related (same subject, not in this thread)

Steven Walter [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help