Change git-svn to parse --no-abbrev-commit --no-decorate to git-log
since it's trying to parse the log output, and the parsing will fail
completely if log.abbrevCommit is set to true in the configuration,
also set --no-decorate so we won't fail if we're processing a commit
that has a tag pointing to it.
Without this patch the code will fail to parse a SHA1, and then just
spew a bunch of "Use of uninitialized value $hash in string eq"
warnings at "if ($c && $c eq $hash) { ..." and never do anything
useful.
A real fix would be to make git-svn not use any porcelain utilities,
but just work around it for now.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-svn.perl | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:52:52
Ævar Arnfjörð Bjarmason wrote:
quoted hunk
--- a/git-svn.perl+++ b/git-svn.perl
@@ -1879,7 +1879,8 @@ sub cmt_sha2rev_batch {subworking_head_info{my($head,$refs)=@_;my@args=qw/log--no-color--no-decorate--first-parent---pretty=medium/;+--pretty=medium--no-abbrev-commit--no-decorate/;+
Oh, dear. Wouldn't
my @args = qw/rev-list --first-parent --pretty=medium/;
be simpler and more robust as a quick fix?
Of course something that takes plain rev-list --first-parent output
and pipes it through to cat-file --batch might be more intuitive, but
rev-list --pretty should at least work. ;-)
On Sun, Jan 29, 2012 at 03:59, Jonathan Nieder [off-list ref] wrote:
Ævar Arnfjörð Bjarmason wrote:
quoted
--- a/git-svn.perl+++ b/git-svn.perl
@@ -1879,7 +1879,8 @@ sub cmt_sha2rev_batch {
sub working_head_info {
my ($head, $refs) = @_;
my @args = qw/log --no-color --no-decorate --first-parent
- --pretty=medium/;
+ --pretty=medium --no-abbrev-commit --no-decorate/;
+
Oh, dear. Wouldn't
my @args = qw/rev-list --first-parent --pretty=medium/;
be simpler and more robust as a quick fix?
Of course something that takes plain rev-list --first-parent output
and pipes it through to cat-file --batch might be more intuitive, but
rev-list --pretty should at least work. ;-)
That sounds like a better fix. I forgot that rev-list could emulate
git-log like that.
Change an invocation of git-rev-list(1) to not use --no-color,
git-rev-list(1) will always ignore that option and the --color option,
so there's no need to pass it.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
git-svn.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Change git-svn to use git-rev-list(1) instead of git-log(1) since the
latter is porcelain that'll cause "git svn rebase" to fail completely
if log.abbrevCommit is set to true in the configuration.
Without this patch the code will fail to parse a SHA1, and then just
spew a bunch of "Use of uninitialized value $hash in string eq"
warnings at "if ($c && $c eq $hash) { ..." and never do anything
useful.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Helped-by: Jonathan Nieder [off-list ref]
---
git-svn.perl | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:53:03
Ævar Arnfjörð Bjarmason wrote:
Change git-svn to use git-rev-list(1) instead of git-log(1) since the
latter is porcelain that'll cause "git svn rebase" to fail completely
if log.abbrevCommit is set to true in the configuration.
[...]
quoted hunk
--- a/git-svn.perl+++ b/git-svn.perl
@@ -1878,8 +1878,7 @@ sub cmt_sha2rev_batch {subworking_head_info{my($head,$refs)=@_;-my@args=qw/log--no-color--no-decorate--first-parent---pretty=medium/;+my@args=qw/rev-list --first-parent --pretty=medium/;
Thanks! The other caller to "git log" in this script uses
--pretty=raw and should be safe.
Reviewed-by: Jonathan Nieder <redacted>
From: Eric Wong <hidden> Date: 2016-06-15 22:53:03
Ævar Arnfjörð Bjarmason [off-list ref] wrote:
Change an invocation of git-rev-list(1) to not use --no-color,
git-rev-list(1) will always ignore that option and the --color option,
so there's no need to pass it.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Acked-by: Eric Wong <redacted>
Thanks, will push this series.