git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: "Robin H. Johnson" <robbat2@gentoo.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git-svn adding too many blank lines during git-cherry-pick, and git-cherry getting confused
Date: Tue, 5 Jun 2007 03:24:49 -0700	[thread overview]
Message-ID: <20070605102449.GB12948@muzzle> (raw)
In-Reply-To: <20070602045007.GJ27013@curie-int.orbis-terrarum.net>

"Robin H. Johnson" <robbat2@gentoo.org> wrote:
> Hi,
> 
> Bit of weirdness I ran into.
> 
> I have a SVN tree, with a branch that gets some backported fixe (they
> usually apply cleanly).
> 
> I commit the fix to the trunk + git-svn dcommit, and then switch to the
> other branch, and git-cherry-pick the fix.
> 
> For git-svn commits, the log has:
> On the trunk side, there is a two blank line before git-svn-id.
> On the branch side, there are three blank lines before git-svn-id.
> If I cherry-pick from that branch to a third branch, I get 4 blank
> lines.
> 
> For regular SVN commits, the log has:
> Only a single blank line before git-svn-id.
> 
> I think the source of the problem is that git-svn-id is being removed
> when cherry-picking, but NOT the leading blank line.
> 
> This all leads to the hashes of the commits diverging badly, and then
> git-cherry gets very confused when asked to compare the trunk vs. the
> branches.
> 
> How do we solve it?
> This is only on a conceptual level here, looking at the present state of
> git-svn, I'm not sure how best to solve it.
> 
> git-svn fetch:
> 1. Get commit message from SVN. 
> 2. Trim ALL trailing blank lines (and existing git-svn-id lines).
> 3. If the last line was header-style (Signed-off-by, CC, etc)
> 3.1. if it was, do not add a blank line.
> 3.2. If not, add a single blank line.
> 4. Insert git-svn-id header.

Too much magic.  I don't think this is a good idea, at least
not by default.

> git-svn dcommit:
> 1. Get commit message (git cat-file commit ....)
> 2. Remove the git-svn-id line.
> 3. Remove all trailing blank lines.
> 4. Commit.

We already do step 3.  The problem is that we fail to remove the newline
*before* the git-svn-id line.  I'll make a mental note to fix this
sometime this week, I hope.

-- 
Eric Wong

      reply	other threads:[~2007-06-05 10:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-02  4:50 git-svn adding too many blank lines during git-cherry-pick, and git-cherry getting confused Robin H. Johnson
2007-06-05 10:24 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070605102449.GB12948@muzzle \
    --to=normalperson@yhbt.net \
    --cc=git@vger.kernel.org \
    --cc=robbat2@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).