# [PATCH] Document git-svn's first-parent rule

5 messages from 2009-11-16 to 2009-11-17. Participants: Thomas Rast, Eric Wong, Junio C Hamano.
Thread: https://gitlist.dev/t/21634

## Thomas Rast, 2009-11-16 10:15

Subject: [PATCH] Document git-svn's first-parent rule
Message-ID: <ea845c8757a629d692bb6cd3827887f0e811c044.1258366486.git.trast@student.ethz.ch>
URL: https://gitlist.dev/e/ea845c8757a629d692bb6cd3827887f0e811c044.1258366486.git.trast%40student.ethz.ch

```
git-svn has the following rule to detect the SVN base for its
operations: find the first git-svn-id line reachable through
first-parent ancestry.  IOW,

  git log --grep=^git-svn-id: --first-parent -1

Document this, as it is very important when using merges with git-svn.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 Documentation/git-svn.txt |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 1812890..6da4151 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -735,6 +735,16 @@ merges you've made.  Furthermore, if you merge or pull from a git branch
 that is a mirror of an SVN branch, 'dcommit' may commit to the wrong
 branch.
 
+If you do merge, note the following rule: 'git svn dcommit' will
+attempt to commit on top of the SVN commit named in
+------------------------------------------------------------------------
+git log --grep=^git-svn-id: --first-parent -1
+------------------------------------------------------------------------
+You 'must' therefore ensure that the most recent commit of the branch
+you want to dcommit to is the 'first' parent of the merge.  Chaos will
+ensue otherwise, especially if the first parent is an older commit on
+the same SVN branch.
+
 'git clone' does not clone branches under the refs/remotes/ hierarchy or
 any 'git svn' metadata, or config.  So repositories created and managed with
 using 'git svn' should use 'rsync' for cloning, if cloning is to be done
-- 
1.6.5.2.427.ge73cb

```

## Eric Wong, 2009-11-16 23:14

Subject: Re: [PATCH] Document git-svn's first-parent rule
Message-ID: <20091116231455.GA13460@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20091116231455.GA13460%40dcvr.yhbt.net
In-Reply-To: <ea845c8757a629d692bb6cd3827887f0e811c044.1258366486.git.trast@student.ethz.ch>

```
Thomas Rast <trast@student.ethz.ch> wrote:
> git-svn has the following rule to detect the SVN base for its
> operations: find the first git-svn-id line reachable through
> first-parent ancestry.  IOW,
> 
>   git log --grep=^git-svn-id: --first-parent -1
> 
> Document this, as it is very important when using merges with git-svn.
> 
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>

Thanks Thomas,

Acked-by: Eric Wong <normalperson@yhbt.net>

> ---
>  Documentation/git-svn.txt |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
> index 1812890..6da4151 100644
> --- a/Documentation/git-svn.txt
> +++ b/Documentation/git-svn.txt
> @@ -735,6 +735,16 @@ merges you've made.  Furthermore, if you merge or pull from a git branch
>  that is a mirror of an SVN branch, 'dcommit' may commit to the wrong
>  branch.
>  
> +If you do merge, note the following rule: 'git svn dcommit' will
> +attempt to commit on top of the SVN commit named in
> +------------------------------------------------------------------------
> +git log --grep=^git-svn-id: --first-parent -1
> +------------------------------------------------------------------------
> +You 'must' therefore ensure that the most recent commit of the branch
> +you want to dcommit to is the 'first' parent of the merge.  Chaos will
> +ensue otherwise, especially if the first parent is an older commit on
> +the same SVN branch.
> +
>  'git clone' does not clone branches under the refs/remotes/ hierarchy or
>  any 'git svn' metadata, or config.  So repositories created and managed with
>  using 'git svn' should use 'rsync' for cloning, if cloning is to be done
> -- 

```

## Junio C Hamano, 2009-11-17 06:25

Subject: Re: [PATCH] Document git-svn's first-parent rule
Message-ID: <7vd43his6n.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vd43his6n.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20091116231455.GA13460@dcvr.yhbt.net>

```
Eric Wong <normalperson@yhbt.net> writes:

> Thomas Rast <trast@student.ethz.ch> wrote:
>> git-svn has the following rule to detect the SVN base for its
>> operations: find the first git-svn-id line reachable through
>> first-parent ancestry.  IOW,
>> 
>>   git log --grep=^git-svn-id: --first-parent -1
>> 
>> Document this, as it is very important when using merges with git-svn.
>> 
>> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
>
> Thanks Thomas,
>
> Acked-by: Eric Wong <normalperson@yhbt.net>

Thanks; is it a good time to pull from your bogomips repository to get
accumulated changes?

```

## Eric Wong, 2009-11-17 07:42

Subject: Re: [PATCH] Document git-svn's first-parent rule
Message-ID: <20091117074208.GA337@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20091117074208.GA337%40dcvr.yhbt.net
In-Reply-To: <7vd43his6n.fsf@alter.siamese.dyndns.org>

```
Junio C Hamano <gitster@pobox.com> wrote:
> Eric Wong <normalperson@yhbt.net> writes:
> 
> > Thomas Rast <trast@student.ethz.ch> wrote:
> >> git-svn has the following rule to detect the SVN base for its
> >> operations: find the first git-svn-id line reachable through
> >> first-parent ancestry.  IOW,
> >> 
> >>   git log --grep=^git-svn-id: --first-parent -1
> >> 
> >> Document this, as it is very important when using merges with git-svn.
> >> 
> >> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
> >
> > Thanks Thomas,
> >
> > Acked-by: Eric Wong <normalperson@yhbt.net>
> 
> Thanks; is it a good time to pull from your bogomips repository to get
> accumulated changes?

Now is, I just pushed to it:

Eric Wong (3):
      git svn: read global+system config for clone+init
      git svn: add authorsfile test case for ~/.gitconfig
      git svn: attempt to create empty dirs on clone+rebase

Thomas Rast (1):
      Document git-svn's first-parent rule

Toby Allsopp (1):
      git svn: handle SVN merges from revisions past the tip of the branch

HEAD=ce45a45f24cc7b3ccc7f6ebcd0025559b4421bda

-- 
Eric Wong

```

## Junio C Hamano, 2009-11-17 18:25

Subject: Re: [PATCH] Document git-svn's first-parent rule
Message-ID: <7vzl6ldn5o.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vzl6ldn5o.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20091117074208.GA337@dcvr.yhbt.net>

```
Eric Wong <normalperson@yhbt.net> writes:

>> Thanks; is it a good time to pull from your bogomips repository to get
>> accumulated changes?
>
> Now is, I just pushed to it:
>
> Eric Wong (3):
>       git svn: read global+system config for clone+init
>       git svn: add authorsfile test case for ~/.gitconfig
>       git svn: attempt to create empty dirs on clone+rebase
>
> Thomas Rast (1):
>       Document git-svn's first-parent rule
>
> Toby Allsopp (1):
>       git svn: handle SVN merges from revisions past the tip of the branch
>
> HEAD=ce45a45f24cc7b3ccc7f6ebcd0025559b4421bda

Thanks, pulled.

```
