# [PATCH] Fix dcommit, rebase when rewriteRoot is in use

6 messages from 2008-03-08 to 2008-03-08. Participants: John Goerzen, Junio C Hamano, Johannes Schindelin, Eric Wong.
Thread: https://gitlist.dev/t/12579

## John Goerzen, 2008-03-08 20:01

Subject: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
Message-ID: <1205006470-18882-1-git-send-email-jgoerzen@complete.org>
URL: https://gitlist.dev/e/1205006470-18882-1-git-send-email-jgoerzen%40complete.org

```
Problem described here:

http://thread.gmane.org/gmane.comp.version-control.git/76561

Signed-off-by: John Goerzen <jgoerzen@complete.org>
---
 git-svn.perl |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 9e2faf9..1195569 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1540,9 +1540,14 @@ sub find_by_url { # repos_root and, path are optional
 			                    $remotes->{$repo_id}->{$_});
 		}
 		my $p = $path;
+		my $rwr = rewrite_root({repo_id => $repo_id});
 		unless (defined $p) {
 			$p = $full_url;
-			$p =~ s#^\Q$u\E(?:/|$)## or next;
+			my $z = $u;
+			if ($rwr) {
+				$z = $rwr;
+			}
+			$p =~ s#^\Q$z\E(?:/|$)## or next;
 		}
 		foreach my $f (keys %$fetch) {
 			next if $f ne $p;
-- 
1.5.4.2


```

## Junio C Hamano, 2008-03-08 21:05

Subject: Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
Message-ID: <7v3ar1sz8x.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v3ar1sz8x.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <1205006470-18882-1-git-send-email-jgoerzen@complete.org>

```
John Goerzen <jgoerzen@complete.org> writes:

> Problem described here:
>
> http://thread.gmane.org/gmane.comp.version-control.git/76561
>
> Signed-off-by: John Goerzen <jgoerzen@complete.org>

While I am sure Eric and git-svn users would appreciate a fix, please do
not write a commit log message like this.

Having a pointer to additional material is a very good practice, and will
be appreciated by the readers, but giving a pointer and nothing else means
that you are forcing your readers to hunt for out-of-line information.

One person who writes can spend an extra few minutes to summarize the
issue, and it will save time and effort for hundreds of readers.

If what is written is worth being read by that many readers, that is, and
in this case I am sure it is ;-).



```

## John Goerzen, 2008-03-08 21:28

Subject: Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
Message-ID: <200803081528.21295.jgoerzen@complete.org>
URL: https://gitlist.dev/e/200803081528.21295.jgoerzen%40complete.org
In-Reply-To: <7v3ar1sz8x.fsf@gitster.siamese.dyndns.org>

```
On Saturday 08 March 2008 3:05:18 pm Junio C Hamano wrote:
> John Goerzen <jgoerzen@complete.org> writes:
> > Problem described here:
> >
> > http://thread.gmane.org/gmane.comp.version-control.git/76561
> >
> > Signed-off-by: John Goerzen <jgoerzen@complete.org>
>
> While I am sure Eric and git-svn users would appreciate a fix, please do
> not write a commit log message like this.
>
> Having a pointer to additional material is a very good practice, and will
> be appreciated by the readers, but giving a pointer and nothing else means
> that you are forcing your readers to hunt for out-of-line information.

Thanks for the note.  Some projects really hate long commit messages, and 
some love them, and I wasn't sure what type of project this is.

Would you like me to rewrite and re-submit this, or are you editing and 
committing?

-- John

```

## Johannes Schindelin, 2008-03-08 21:32

Subject: Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
Message-ID: <alpine.LSU.1.00.0803082231540.3975@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0803082231540.3975%40racer.site
In-Reply-To: <1205006470-18882-1-git-send-email-jgoerzen@complete.org>

```
Hi,

On Sat, 8 Mar 2008, John Goerzen wrote:

> Problem described here:
> 
> http://thread.gmane.org/gmane.comp.version-control.git/76561
> 
> Signed-off-by: John Goerzen <jgoerzen@complete.org>

That is not a good commit message.

Hth,
Dscho

```

## Eric Wong, 2008-03-08 21:52

Subject: Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
Message-ID: <20080308215248.GB30702@hand.yhbt.net>
URL: https://gitlist.dev/e/20080308215248.GB30702%40hand.yhbt.net
In-Reply-To: <200803081528.21295.jgoerzen@complete.org>

```
John Goerzen <jgoerzen@complete.org> wrote:
> On Saturday 08 March 2008 3:05:18 pm Junio C Hamano wrote:
> > John Goerzen <jgoerzen@complete.org> writes:
> > > Problem described here:
> > >
> > > http://thread.gmane.org/gmane.comp.version-control.git/76561
> > >
> > > Signed-off-by: John Goerzen <jgoerzen@complete.org>

for the actual code, not the commit message:

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

> > While I am sure Eric and git-svn users would appreciate a fix, please do
> > not write a commit log message like this.
> >
> > Having a pointer to additional material is a very good practice, and will
> > be appreciated by the readers, but giving a pointer and nothing else means
> > that you are forcing your readers to hunt for out-of-line information.
> 
> Thanks for the note.  Some projects really hate long commit messages, and 
> some love them, and I wasn't sure what type of project this is.

We are the latter :)

One thing I've found with distributed VCS is that it's easier and
convenient to write very detailed commit messages as documentation so I
can go back and reference them easily.

Also, the commit messages are written in the heat of the moment so the
code is fresh in my mind rather than going back at the end and then
writing more documentation/comments later on.  With this synchronous
behavior, the commit message will always valid for that particular
changeset.

Probably due to my workflow, I've always found asynchronously maintained
code and documentation to be quite difficult and documentation always
dragged behind.

> Would you like me to rewrite and re-submit this, or are you editing and 
> committing?

I'd prefer it'd be straight from the patch author's mouth/fingers :)

Thanks John,

-- 
Eric Wong

```

## John Goerzen, 2008-03-08 22:04

Subject: Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
Message-ID: <200803081604.18675.jgoerzen@complete.org>
URL: https://gitlist.dev/e/200803081604.18675.jgoerzen%40complete.org
In-Reply-To: <alpine.LSU.1.00.0803082231540.3975@racer.site>

```
On Saturday 08 March 2008 3:32:20 pm Johannes Schindelin wrote:
> Hi,
>
> On Sat, 8 Mar 2008, John Goerzen wrote:
> > Problem described here:
> >
> > http://thread.gmane.org/gmane.comp.version-control.git/76561
> >
> > Signed-off-by: John Goerzen <jgoerzen@complete.org>
>
> That is not a good commit message.
>
> Hth,
> Dscho

Thanks, folks.  I have sent a new patch with a longer explanation.

```
