# [PATCH] make git-svn resilient to log.abbrevcommit = true

3 messages from 2011-11-24 to 2011-11-24. Participants: Shahid Alam, Thomas Rast, Eric Wong.
Thread: https://gitlist.dev/t/29015

## Shahid Alam, 2011-11-24 07:16

Subject: [PATCH] make git-svn resilient to log.abbrevcommit = true
Message-ID: <3A78B8F7-803C-4278-8B5F-4A1B02C9FF04@gmail.com>
URL: https://gitlist.dev/e/3A78B8F7-803C-4278-8B5F-4A1B02C9FF04%40gmail.com

```
Add --no-abbrev-commit arg to working_head_Info()'s invocation
of git log.
---
git-svn.perl |    2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 351e743..da4c240 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1803,7 +1803,7 @@ sub cmt_sha2rev_batch {
sub working_head_info {
	my ($head, $refs) = @_;
	my @args = qw/log --no-color --no-decorate --first-parent
-	              --pretty=medium/;
+	              --no-abbrev-commit --pretty=medium/;
	my ($fh, $ctx) = command_output_pipe(@args, $head);
	my $hash;
	my %max;
-- 
1.7.7.2

```

## Thomas Rast, 2011-11-24 13:11

Subject: Re: [PATCH] make git-svn resilient to log.abbrevcommit = true
Message-ID: <201111241411.05655.trast@student.ethz.ch>
URL: https://gitlist.dev/e/201111241411.05655.trast%40student.ethz.ch
In-Reply-To: <3A78B8F7-803C-4278-8B5F-4A1B02C9FF04@gmail.com>

```
[add Eric to Cc]

Shahid Alam wrote:
> Add --no-abbrev-commit arg to working_head_Info()'s invocation
> of git log.
[...]
> @@ -1803,7 +1803,7 @@ sub cmt_sha2rev_batch {
> sub working_head_info {
> 	my ($head, $refs) = @_;
> 	my @args = qw/log --no-color --no-decorate --first-parent
> -	              --pretty=medium/;
> +	              --no-abbrev-commit --pretty=medium/;

Undeniably a bug, but to prevent the same from happening again,
wouldn't it be better to rewrite it using simply

  rev-list --first-parent --pretty=medium

?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

```

## Eric Wong, 2011-11-24 18:32

Subject: Re: [PATCH] make git-svn resilient to log.abbrevcommit = true
Message-ID: <20111124183233.GA22111@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20111124183233.GA22111%40dcvr.yhbt.net
In-Reply-To: <201111241411.05655.trast@student.ethz.ch>

```
Thomas Rast <trast@student.ethz.ch> wrote:
> Shahid Alam wrote:
> > Add --no-abbrev-commit arg to working_head_Info()'s invocation
> > of git log.
> [...]
> > @@ -1803,7 +1803,7 @@ sub cmt_sha2rev_batch {
> > sub working_head_info {
> > 	my ($head, $refs) = @_;
> > 	my @args = qw/log --no-color --no-decorate --first-parent
> > -	              --pretty=medium/;
> > +	              --no-abbrev-commit --pretty=medium/;
> 
> Undeniably a bug, but to prevent the same from happening again,
> wouldn't it be better to rewrite it using simply
> 
>   rev-list --first-parent --pretty=medium

Yes, I've never been happy with using "git log" for any internals since
it's a porcelain.  I'll gladly accept a tested patch which uses rev-list
instead.  Thanks!

```
