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

Re: git svn log: Use of uninitialized value $sha1_short

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 21, 2020, 20:48 UTC
Message-ID
<xmqqwnzj5mq5.fsf@gitster.c.googlers.com>
In-Reply-To
<20201021202642.GA60606@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 21 quoted lines
> It seems to only get mentioned once and never set:
>
>   $ git grep sha1_short perl
>   perl/Git/SVN/Log.pm:            } elsif (/^${esc_color}:\d{6} \d{6} $::sha1_short/o) {
>
> Looks like it got renamed, and this reference was somehow missed?
>
>   $ git log -1 -Ssha1_short perl
>   commit 9ab33150a0d14089d0496dd8354d4a969e849571
>   Author: brian m. carlson <sandals@crustytoothpaste.net>
>   Date:   Mon Jun 22 18:04:12 2020 +0000
>   
>       perl: create and switch variables for hash constants
>       
>       git-svn has several variables for SHA-1 constants, including short hash
>       values and full length hash values.  Since these are no longer SHA-1
>       specific, let's start them with "oid" instead of "sha1".  Add a
>       constant, oid_length, which is the length of the hash algorithm in use
>       in hex.  We use the hex version because overwhelmingly that's what's
>       used by git-svn.
>   [...]

Looks that way. '$::' as opposed to plain '$' threw the replacement off the track?

 perl/Git/SVN/Log.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git i/perl/Git/SVN/Log.pm w/perl/Git/SVN/Log.pm
index 3858fcf27d..9c819188ea 100644
--- i/perl/Git/SVN/Log.pm
+++ w/perl/Git/SVN/Log.pm
@@ -298,7 +298,7 @@ sub cmd_show_log {
 			get_author_info($c, $1, $2, $3);
 		} elsif (/^${esc_color}(?:tree|parent|committer) /o) {
 			# ignore
-		} elsif (/^${esc_color}:\d{6} \d{6} $::sha1_short/o) {
+		} elsif (/^${esc_color}:\d{6} \d{6} $::oid_short/o) {
 			push @{$c->{raw}}, $_;
 		} elsif (/^${esc_color}[ACRMDT]\t/) {
 			# we could add $SVN->{svn_path} here, but that requires
Previous: Jeff KingNext: Jeff King
Message 3 of 11 in “git svn log: Use of uninitialized value $sha1_short”
  1. Nikos ChantziarasOct 21, 2020
  2. Jeff KingOct 21, 2020
  3. Junio C HamanoOct 21, 2020
  4. Jeff KingOct 21, 2020
  5. brian m. carlsonOct 21, 2020
  6. Jeff KingOct 22, 2020
  7. brian m. carlsonOct 21, 2020
  8. svn: use correct variable name for short OIDbrian m. carlson, Oct 22, 2020
  9. Jeff KingOct 22, 2020
  10. Jeff KingOct 22, 2020
  11. Junio C HamanoOct 22, 2020

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.