From: Vasco Almeida Date: Sat, 10 Dec 2016 10:08:16 GMT Subject: Re: [PATCH v6 01/16] Git.pm: add subroutines for commenting lines Message-ID: <1481364496.1993.14.camel@sapo.pt> In-Reply-To: A Sex, 09-12-2016 às 14:23 -0800, Junio C Hamano escreveu: > > This is exactly the same issue I fixed for rebase -i recently. > > Yes, but the patch we see here punts "core.commentChar is not a > single-byte single-letter--panic!" case differently.  I think you > did "just take the first one" in "rebase -i", which I think is more > in line with the rest of the system, and this addition to Git.pm > should do the same, I think. I hope the changes below are in line with the rest of the system. If so, I will send a new re-roll with them. I wonder why this is important when Git errors out when core.commentChar is set to more than 1 characters or 0 characters. Is it just to be consistent with "rebase -i" changes introduced by Johannes Schindelin? I am not sure what does "if (length($comment_line_char) != 1)" check. Whether it checks single-byte or single-letter or both... -- >8 -- diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 3a6d846..4e0ab5a 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -1072,7 +1072,7 @@ sub edit_hunk_manually {   print $fh @$oldtext;   my $is_reverse = $patch_mode_flavour{IS_REVERSE};   my ($remove_plus, $remove_minus) = $is_reverse ? ('-', '+') : ('+', '-'); - my $comment_line_char = Git::config("core.commentchar") || '#'; + my $comment_line_char = Git::get_comment_line_char;   print $fh Git::comment_lines sprintf(__ <