Git development
 help / color / mirror / Atom feed
* [PATCH] Fix dcommit, rebase when rewriteRoot is in use
@ 2008-03-08 20:01 John Goerzen
  2008-03-08 21:05 ` Junio C Hamano
  2008-03-08 21:32 ` Johannes Schindelin
  0 siblings, 2 replies; 8+ messages in thread
From: John Goerzen @ 2008-03-08 20:01 UTC (permalink / raw)
  To: git; +Cc: normalperson, John Goerzen

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
  2008-03-08 20:01 [PATCH] Fix dcommit, rebase when rewriteRoot is in use John Goerzen
@ 2008-03-08 21:05 ` Junio C Hamano
  2008-03-08 21:28   ` John Goerzen
  2008-03-08 21:32 ` Johannes Schindelin
  1 sibling, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2008-03-08 21:05 UTC (permalink / raw)
  To: John Goerzen; +Cc: git, normalperson

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 ;-).



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
  2008-03-08 21:05 ` Junio C Hamano
@ 2008-03-08 21:28   ` John Goerzen
  2008-03-08 21:52     ` Eric Wong
  0 siblings, 1 reply; 8+ messages in thread
From: John Goerzen @ 2008-03-08 21:28 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, normalperson

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
  2008-03-08 20:01 [PATCH] Fix dcommit, rebase when rewriteRoot is in use John Goerzen
  2008-03-08 21:05 ` Junio C Hamano
@ 2008-03-08 21:32 ` Johannes Schindelin
  2008-03-08 22:04   ` John Goerzen
  1 sibling, 1 reply; 8+ messages in thread
From: Johannes Schindelin @ 2008-03-08 21:32 UTC (permalink / raw)
  To: John Goerzen; +Cc: git, normalperson

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
  2008-03-08 21:28   ` John Goerzen
@ 2008-03-08 21:52     ` Eric Wong
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Wong @ 2008-03-08 21:52 UTC (permalink / raw)
  To: John Goerzen; +Cc: Junio C Hamano, git

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] Fix dcommit, rebase when rewriteRoot is in use
@ 2008-03-08 22:04 John Goerzen
  2008-03-08 22:22 ` Eric Wong
  0 siblings, 1 reply; 8+ messages in thread
From: John Goerzen @ 2008-03-08 22:04 UTC (permalink / raw)
  To: git; +Cc: normalperson, John Goerzen

When the rewriteRoot setting is used with git-svn, it causes the svn
IDs added to commit messages to bear a different URL than is actually
used to retrieve Subversion data.

It is common for Subversion repositories to be available multiple
ways: for instance, HTTP to the public, and svn+ssh to people with
commit access.  The need to switch URLs for access is fairly common as
well -- perhaps someone was just given commit access.  To switch URLs
without having to rewrite history, one can use the old url as a
rewriteRoot, and use the new one in the svn-remote url setting.

This works well for svn fetching and general git commands.

However, git-svn dcommit, rebase, and perhaps other commands do not
work in this scenario.  They scan the svn ID lines in commit messages
and attempt to match them up with url lines in [svn-remote] sections
in the git config.

This patch allows them to match rewriteRoot options, if such options
are present.

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
  2008-03-08 21:32 ` Johannes Schindelin
@ 2008-03-08 22:04   ` John Goerzen
  0 siblings, 0 replies; 8+ messages in thread
From: John Goerzen @ 2008-03-08 22:04 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git, normalperson

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
  2008-03-08 22:04 John Goerzen
@ 2008-03-08 22:22 ` Eric Wong
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Wong @ 2008-03-08 22:22 UTC (permalink / raw)
  To: John Goerzen; +Cc: git

John Goerzen <jgoerzen@complete.org> wrote:
> When the rewriteRoot setting is used with git-svn, it causes the svn
> IDs added to commit messages to bear a different URL than is actually
> used to retrieve Subversion data.
> 
> It is common for Subversion repositories to be available multiple
> ways: for instance, HTTP to the public, and svn+ssh to people with
> commit access.  The need to switch URLs for access is fairly common as
> well -- perhaps someone was just given commit access.  To switch URLs
> without having to rewrite history, one can use the old url as a
> rewriteRoot, and use the new one in the svn-remote url setting.
> 
> This works well for svn fetching and general git commands.
> 
> However, git-svn dcommit, rebase, and perhaps other commands do not
> work in this scenario.  They scan the svn ID lines in commit messages
> and attempt to match them up with url lines in [svn-remote] sections
> in the git config.
> 
> This patch allows them to match rewriteRoot options, if such options
> are present.
> 
> Signed-off-by: John Goerzen <jgoerzen@complete.org>

Thanks again, patch + commit message
Acked-by: Eric Wong <normalperson@yhbt.net>

> ---
>  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
> 

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-03-08 22:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-08 20:01 [PATCH] Fix dcommit, rebase when rewriteRoot is in use John Goerzen
2008-03-08 21:05 ` Junio C Hamano
2008-03-08 21:28   ` John Goerzen
2008-03-08 21:52     ` Eric Wong
2008-03-08 21:32 ` Johannes Schindelin
2008-03-08 22:04   ` John Goerzen
  -- strict thread matches above, loose matches on Subject: below --
2008-03-08 22:04 John Goerzen
2008-03-08 22:22 ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox