Re: [PATCH 2/1] git svn: remove extraneous newline from log output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jens Seidel <jensseidel@xxxxxxxxxxxx> wrote:
> Hi Eric,
> 
> On Sun, Jul 25, 2010 at 08:13:44AM +0000, Eric Wong wrote:
> > This is to match the output of "svn log", which does not
> > add an extra newline before the next log entry.
> 
> thanks for the patch but it doesn't work in the general case.
> 
> I attached a sample Subversion repository dump where the output of
> git svn log and svn log still differs by empty lines.
> 
> I also noticed the following error:
> Can't use an undefined value as an ARRAY reference at                                                                                            
> /usr/lib/git-core/git-svn line 5717, <$fh> line 53.
> 
> I'm not sure whether I introduced this error once I patched
> git-svn ...
> The affected line is the second one in:
>            } elsif (/^${esc_color}    (git-svn-id:.+)$/o) {
>                         if (@{$c->{l}} && $c->{l}->[-1] eq "\n") {
>                                 pop @{$c->{l}};
>                         }
> (is -1 valid?)

Yes, -1 is valid but $c->{l} may not exist at that point..

But I had forgotten about a similar piece of code in the
"show_commit_normal" subroutine which does a similar job:

		while ($l->[$#$l] eq "\n" && $#$l > 0
		                          && $l->[($#$l - 1)] eq "\n") {
			pop @$l;
		}

This is partially because SVN doesn't enforce a trailing "\n" in
commit messages (unlike "git commit"), so we always append one
when we fetch and add "\ngit-svn-id: ...\n".  But then we also
need to take noMetadata users into account, too.

I'll let you ponder issues with this since you appear to care more than
I do about completely matching SVN output :)


For what it's worth, over the years, nobody ever "outed" me as a git-svn
user in SVN projects when I shared log output.  Some folks worked with
for years in the same offices and never made indication to knowing I
used git-svn (even after they started using it themselves).

-- 
Eric Wong
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]