threads / patch / 12579

patchFix dcommit, rebase when rewriteRoot is in use

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

## tl;dr

6 messages between Mar 8, 2008 and Mar 8, 2008. Diffs are folded; open one to read it.

replies: 5people: 4as markdown or json

John Goerzen· Mar 8, 2008, 20:01 UTC · lore
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(-)
Show changes to git-svn.perl +6 −1
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· Mar 8, 2008, 21:05 UTC · re: John Goerzen · lore

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

John Goerzen <jgoerzen@complete.org> writes:
Show 5 quoted lines
> 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· Mar 8, 2008, 21:28 UTC · re: Junio C Hamano · lore

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

On Saturday 08 March 2008 3:05:18 pm Junio C Hamano wrote:
Show 13 quoted lines
> 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
Eric Wong· Mar 8, 2008, 21:52 UTC · re: John Goerzen · lore

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

John Goerzen <jgoerzen@complete.org> wrote:
Show 7 quoted lines
> 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>
Show 9 quoted lines
> > 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
Johannes Schindelin· Mar 8, 2008, 21:32 UTC · re: John Goerzen · lore

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

Hi,
On Sat, 8 Mar 2008, John Goerzen wrote:
Show 5 quoted lines
> 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

John Goerzen· Mar 8, 2008, 22:04 UTC · re: Johannes Schindelin · lore

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

On Saturday 08 March 2008 3:32:20 pm Johannes Schindelin wrote:
Show 13 quoted lines
> 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.

← back to recent threads