git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-svn: try to read the dcommit url from the config file
@ 2009-02-19 18:30 Peter Oberndorfer
  2009-02-19 18:47 ` git svn dcommit difficulties/feature request Peter Oberndorfer
  2009-02-21 12:08 ` [PATCH] git-svn: try to read the dcommit url from the config file Eric Wong
  0 siblings, 2 replies; 10+ messages in thread
From: Peter Oberndorfer @ 2009-02-19 18:30 UTC (permalink / raw)
  To: git

The commit url is determined in the following order
--commit-url commandline
svn-remote.<name>.dcommiturl
svn-remote.<name>.url

Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
---

I find it really boring to always specify --commit-url on the git svn dcommit command line.
And it tends to fall out of my bash_history since i do not commit often.
Setting up the commit url 1 time should be enough.

I feel that the config key: part im the documentation should get more exposure or explanation.
Maybe somebody can suggest some wording?

Also the dcommiturl name is still a suggestion

My kdelibs git-svn config file no looks like this:

[svn-remote "svn"]
	url = svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
	fetch = :refs/remotes/git-svn
	dcommiturl = svn+ssh://username@svn.kde.org/home/kde/trunk/KDE/kdelibs


 Documentation/git-svn.txt |    2 ++
 git-svn.perl              |   12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 3d45654..0d11428 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -169,6 +169,8 @@ and have no uncommitted changes.
 	reused if a user is later given access to an alternate transport
 	method (e.g. `svn+ssh://` or `https://`) for commit.
 
+config key: svn-remote.<name>.dcommiturl
+
 	Using this option for any other purpose (don't ask)
 	is very strongly discouraged.
 --
diff --git a/git-svn.perl b/git-svn.perl
index 83cb36f..2ad3603 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -438,7 +438,17 @@ sub cmd_dcommit {
 		die "Unable to determine upstream SVN information from ",
 		    "$head history.\nPerhaps the repository is empty.";
 	}
-	$url = defined $_commit_url ? $_commit_url : $gs->full_url;
+
+	if (defined $_commit_url) {
+		$url = $_commit_url;
+	} else {
+		$url = eval { command_oneline('config', '--get',
+			      "svn-remote.$gs->{repo_id}.dcommiturl") };
+		if (!$url) {
+			$url = $gs->full_url
+		}
+	}
+
 	my $last_rev = $_revision if defined $_revision;
 	if ($url) {
 		print "Committing to $url ...\n";
-- 
1.6.1.3

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

* git svn dcommit difficulties/feature request
  2009-02-19 18:30 [PATCH] git-svn: try to read the dcommit url from the config file Peter Oberndorfer
@ 2009-02-19 18:47 ` Peter Oberndorfer
  2009-02-20 12:59   ` Kevin Menard
  2009-02-21 12:12   ` Eric Wong
  2009-02-21 12:08 ` [PATCH] git-svn: try to read the dcommit url from the config file Eric Wong
  1 sibling, 2 replies; 10+ messages in thread
From: Peter Oberndorfer @ 2009-02-19 18:47 UTC (permalink / raw)
  To: git

Hi,

With the patch i am replying to git-svn got a bit more comfortable for me but 
there is still a problem left.

I fetch via svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
and push to svn+ssh://YOUR_LOGIN@svn.kde.org/home/kde/trunk/KDE/kdelibs

Pushing multiple changes at once to KDE servers with different fetch/commit 
url is not possible for me.

Here is what it think what happens during a push:
git svn dcommit pushes the first commit to svn.kde.org,
then tries to fetch what it just pushed from anonsvn.kde.org
(which lags behind authenticated svn by a few minutes).

git svn does not see the just committed changes, gets confused
and stops pushing the rest of the commits.

My idea would be to temporarily fetch from the authenticated server, but not 
update the current head and revdb., so nothing is affected beside the push.
But this seems quite complicated.
Or do not care about difference between fetch/dcommit url, and just fetch from 
the dcommit url during dcommit.

Anybody have a good idea if this is possible or a better way to solve this 
problem?

Greetings Peter

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

* Re: git svn dcommit difficulties/feature request
  2009-02-19 18:47 ` git svn dcommit difficulties/feature request Peter Oberndorfer
@ 2009-02-20 12:59   ` Kevin Menard
  2009-02-21 12:12   ` Eric Wong
  1 sibling, 0 replies; 10+ messages in thread
From: Kevin Menard @ 2009-02-20 12:59 UTC (permalink / raw)
  To: Peter Oberndorfer; +Cc: git

We've run into the same issue with the experimental git support at the
ASF.  We dcommit to an EU mirror which lags behind the primary one for
a couple minutes.  While annoying, I don't think there's much that can
be done other than to commit and read from the master SVN server.
Otherwise, plan on getting good at "git svn dcommit; git svn rebase".
I tolerate this step because I think using git on top of SVN, even
with this lag, makes me more productive than SVN alone.

-- 
Kevin



On Thu, Feb 19, 2009 at 1:47 PM, Peter Oberndorfer <kumbayo84@arcor.de> wrote:
> Hi,
>
> With the patch i am replying to git-svn got a bit more comfortable for me but
> there is still a problem left.
>
> I fetch via svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
> and push to svn+ssh://YOUR_LOGIN@svn.kde.org/home/kde/trunk/KDE/kdelibs
>
> Pushing multiple changes at once to KDE servers with different fetch/commit
> url is not possible for me.
>
> Here is what it think what happens during a push:
> git svn dcommit pushes the first commit to svn.kde.org,
> then tries to fetch what it just pushed from anonsvn.kde.org
> (which lags behind authenticated svn by a few minutes).
>
> git svn does not see the just committed changes, gets confused
> and stops pushing the rest of the commits.
>
> My idea would be to temporarily fetch from the authenticated server, but not
> update the current head and revdb., so nothing is affected beside the push.
> But this seems quite complicated.
> Or do not care about difference between fetch/dcommit url, and just fetch from
> the dcommit url during dcommit.
>
> Anybody have a good idea if this is possible or a better way to solve this
> problem?
>
> Greetings Peter
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH] git-svn: try to read the dcommit url from the config file
  2009-02-19 18:30 [PATCH] git-svn: try to read the dcommit url from the config file Peter Oberndorfer
  2009-02-19 18:47 ` git svn dcommit difficulties/feature request Peter Oberndorfer
@ 2009-02-21 12:08 ` Eric Wong
  2009-02-22 21:41   ` Peter Oberndorfer
  1 sibling, 1 reply; 10+ messages in thread
From: Eric Wong @ 2009-02-21 12:08 UTC (permalink / raw)
  To: Peter Oberndorfer; +Cc: git

Peter Oberndorfer <kumbayo84@arcor.de> wrote:
> The commit url is determined in the following order
> --commit-url commandline

actually, it should look in the .git/config for this, too:

  svn.commiturl

> svn-remote.<name>.dcommiturl

Of course, having a per-svn-remote commiturl can be useful, too.

Though I'd call it "commiturl" instead of "dcommiturl" to match the
existing config setting.  The not-often-used "set-tree" command could
probably be updated to use these config options, too...

I'll ack this patch with "dcommiturl" replaced with "commiturl".

> svn-remote.<name>.url
> 
> Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
> ---
> 
> I find it really boring to always specify --commit-url on the git svn dcommit command line.
> And it tends to fall out of my bash_history since i do not commit often.
> Setting up the commit url 1 time should be enough.
> 
> I feel that the config key: part im the documentation should get more exposure or explanation.
> Maybe somebody can suggest some wording?
> 
> Also the dcommiturl name is still a suggestion
> 
> My kdelibs git-svn config file no looks like this:
> 
> [svn-remote "svn"]
> 	url = svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
> 	fetch = :refs/remotes/git-svn
> 	dcommiturl = svn+ssh://username@svn.kde.org/home/kde/trunk/KDE/kdelibs
> 
> 
>  Documentation/git-svn.txt |    2 ++
>  git-svn.perl              |   12 +++++++++++-
>  2 files changed, 13 insertions(+), 1 deletions(-)
> 
> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
> index 3d45654..0d11428 100644
> --- a/Documentation/git-svn.txt
> +++ b/Documentation/git-svn.txt
> @@ -169,6 +169,8 @@ and have no uncommitted changes.
>  	reused if a user is later given access to an alternate transport
>  	method (e.g. `svn+ssh://` or `https://`) for commit.
>  
> +config key: svn-remote.<name>.dcommiturl
> +
>  	Using this option for any other purpose (don't ask)
>  	is very strongly discouraged.
>  --
> diff --git a/git-svn.perl b/git-svn.perl
> index 83cb36f..2ad3603 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -438,7 +438,17 @@ sub cmd_dcommit {
>  		die "Unable to determine upstream SVN information from ",
>  		    "$head history.\nPerhaps the repository is empty.";
>  	}
> -	$url = defined $_commit_url ? $_commit_url : $gs->full_url;
> +
> +	if (defined $_commit_url) {
> +		$url = $_commit_url;
> +	} else {
> +		$url = eval { command_oneline('config', '--get',
> +			      "svn-remote.$gs->{repo_id}.dcommiturl") };
> +		if (!$url) {
> +			$url = $gs->full_url
> +		}
> +	}
> +
>  	my $last_rev = $_revision if defined $_revision;
>  	if ($url) {
>  		print "Committing to $url ...\n";
> -- 
> 1.6.1.3

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

* Re: git svn dcommit difficulties/feature request
  2009-02-19 18:47 ` git svn dcommit difficulties/feature request Peter Oberndorfer
  2009-02-20 12:59   ` Kevin Menard
@ 2009-02-21 12:12   ` Eric Wong
  1 sibling, 0 replies; 10+ messages in thread
From: Eric Wong @ 2009-02-21 12:12 UTC (permalink / raw)
  To: Peter Oberndorfer; +Cc: git

Peter Oberndorfer <kumbayo84@arcor.de> wrote:
> Hi,
> 
> With the patch i am replying to git-svn got a bit more comfortable for me but 
> there is still a problem left.
> 
> I fetch via svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
> and push to svn+ssh://YOUR_LOGIN@svn.kde.org/home/kde/trunk/KDE/kdelibs
> 
> Pushing multiple changes at once to KDE servers with different fetch/commit 
> url is not possible for me.
> 
> Here is what it think what happens during a push:
> git svn dcommit pushes the first commit to svn.kde.org,
> then tries to fetch what it just pushed from anonsvn.kde.org
> (which lags behind authenticated svn by a few minutes).
> 
> git svn does not see the just committed changes, gets confused
> and stops pushing the rest of the commits.
> 
> My idea would be to temporarily fetch from the authenticated server, but not 
> update the current head and revdb., so nothing is affected beside the push.
> But this seems quite complicated.
> Or do not care about difference between fetch/dcommit url, and just fetch from 
> the dcommit url during dcommit.
> 
> Anybody have a good idea if this is possible or a better way to solve this 
> problem?

You could probably look into how rewriteRoot works and set that on a
temporary basis in memory.  In fact, that should probably be a default
when using --commit-url iny any form...

-- 
Eric Wong

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

* Re: [PATCH] git-svn: try to read the dcommit url from the config file
  2009-02-21 12:08 ` [PATCH] git-svn: try to read the dcommit url from the config file Eric Wong
@ 2009-02-22 21:41   ` Peter Oberndorfer
  2009-02-23  2:05     ` Eric Wong
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Oberndorfer @ 2009-02-22 21:41 UTC (permalink / raw)
  To: Eric Wong; +Cc: git

On Samstag 21 Februar 2009, Eric Wong wrote:
> Peter Oberndorfer <kumbayo84@arcor.de> wrote:
> > The commit url is determined in the following order
> > --commit-url commandline
> 
> actually, it should look in the .git/config for this, too:
> 
>   svn.commiturl
> 

I did not see that the commandline options are also searched in the config.
Also this option does not seem to be documented.
Should i document svn.commiturl in dcommit or is that just a implementation detail.

> > svn-remote.<name>.dcommiturl
> 
> Of course, having a per-svn-remote commiturl can be useful, too.
> 
> Though I'd call it "commiturl" instead of "dcommiturl" to match the
> existing config setting.  The not-often-used "set-tree" command could
> probably be updated to use these config options, too...
> 

sorry, i do not understand enough of perl/git-svn to do this :-(

> I'll ack this patch with "dcommiturl" replaced with "commiturl".
> 

OK, will resend the patch once i know if i should document svn.commiturl.

> > svn-remote.<name>.url
> > 
> > Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
> > ---
> > 

Greetings Peter

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

* Re: [PATCH] git-svn: try to read the dcommit url from the config file
  2009-02-22 21:41   ` Peter Oberndorfer
@ 2009-02-23  2:05     ` Eric Wong
  2009-02-23 11:02       ` [PATCH] git-svn: read the dcommit url from the config file on a per remote basis Peter Oberndorfer
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Wong @ 2009-02-23  2:05 UTC (permalink / raw)
  To: Peter Oberndorfer; +Cc: git

Peter Oberndorfer <kumbayo84@arcor.de> wrote:
> On Samstag 21 Februar 2009, Eric Wong wrote:
> > Peter Oberndorfer <kumbayo84@arcor.de> wrote:
> > > The commit url is determined in the following order
> > > --commit-url commandline
> > 
> > actually, it should look in the .git/config for this, too:
> > 
> >   svn.commiturl
> > 
> 
> I did not see that the commandline options are also searched in the
> config.  Also this option does not seem to be documented.  Should i
> document svn.commiturl in dcommit or is that just a implementation
> detail.

Please document svn.commiturl, thanks

> > > svn-remote.<name>.dcommiturl
> > 
> > Of course, having a per-svn-remote commiturl can be useful, too.
> > 
> > Though I'd call it "commiturl" instead of "dcommiturl" to match the
> > existing config setting.  The not-often-used "set-tree" command could
> > probably be updated to use these config options, too...
> > 
> 
> sorry, i do not understand enough of perl/git-svn to do this :-(

Don't worry about set-tree, for now :) dcommit has been the recommended
workflow for a while now so very few people use set-tree (it's highly
git-centric and makes history confusing to SVN users).

> > I'll ack this patch with "dcommiturl" replaced with "commiturl".
> > 
> 
> OK, will resend the patch once i know if i should document svn.commiturl.

Thanks Peter

-- 
Eric Wong

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

* [PATCH] git-svn: read the dcommit url from the config file on a per remote basis
  2009-02-23  2:05     ` Eric Wong
@ 2009-02-23 11:02       ` Peter Oberndorfer
  2009-02-23 22:45         ` Eric Wong
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Oberndorfer @ 2009-02-23 11:02 UTC (permalink / raw)
  To: Eric Wong; +Cc: git, Junio C Hamano

The commit url for dcommit is determined in the following order:
commandline option --commit-url
svn.commiturl
svn-remote.<name>.commiturl
svn-remote.<name>.url

Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
---
Now with a short documentation for svn.commiturl.
I hope the wording is OK.

 Documentation/git-svn.txt |    4 ++++
 git-svn.perl              |   12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 3d45654..cda3389 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -169,6 +169,10 @@ and have no uncommitted changes.
 	reused if a user is later given access to an alternate transport
 	method (e.g. `svn+ssh://` or `https://`) for commit.
 
+config key: svn-remote.<name>.commiturl
+
+config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
+
 	Using this option for any other purpose (don't ask)
 	is very strongly discouraged.
 --
diff --git a/git-svn.perl b/git-svn.perl
index cbc5211..be4d011 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -438,7 +438,17 @@ sub cmd_dcommit {
 		die "Unable to determine upstream SVN information from ",
 		    "$head history.\nPerhaps the repository is empty.";
 	}
-	$url = defined $_commit_url ? $_commit_url : $gs->full_url;
+
+	if (defined $_commit_url) {
+		$url = $_commit_url;
+	} else {
+		$url = eval { command_oneline('config', '--get',
+			      "svn-remote.$gs->{repo_id}.commiturl") };
+		if (!$url) {
+			$url = $gs->full_url
+		}
+	}
+
 	my $last_rev = $_revision if defined $_revision;
 	if ($url) {
 		print "Committing to $url ...\n";
-- 
1.6.1.3

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

* Re: [PATCH] git-svn: read the dcommit url from the config file on a per remote basis
  2009-02-23 11:02       ` [PATCH] git-svn: read the dcommit url from the config file on a per remote basis Peter Oberndorfer
@ 2009-02-23 22:45         ` Eric Wong
  2009-02-23 23:06           ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Wong @ 2009-02-23 22:45 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Peter Oberndorfer, git

Peter Oberndorfer <kumbayo84@arcor.de> wrote:
> The commit url for dcommit is determined in the following order:
> commandline option --commit-url
> svn.commiturl
> svn-remote.<name>.commiturl
> svn-remote.<name>.url
> 
> Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>

> ---
> Now with a short documentation for svn.commiturl.
> I hope the wording is OK.

Thanks Peter, the wording is fine.

Acked and pushed out to git://git.bogomips.org/git-svn

>  Documentation/git-svn.txt |    4 ++++
>  git-svn.perl              |   12 +++++++++++-
>  2 files changed, 15 insertions(+), 1 deletions(-)
> 
> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
> index 3d45654..cda3389 100644
> --- a/Documentation/git-svn.txt
> +++ b/Documentation/git-svn.txt
> @@ -169,6 +169,10 @@ and have no uncommitted changes.
>  	reused if a user is later given access to an alternate transport
>  	method (e.g. `svn+ssh://` or `https://`) for commit.
>  
> +config key: svn-remote.<name>.commiturl
> +
> +config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
> +
>  	Using this option for any other purpose (don't ask)
>  	is very strongly discouraged.
>  --
> diff --git a/git-svn.perl b/git-svn.perl
> index cbc5211..be4d011 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -438,7 +438,17 @@ sub cmd_dcommit {
>  		die "Unable to determine upstream SVN information from ",
>  		    "$head history.\nPerhaps the repository is empty.";
>  	}
> -	$url = defined $_commit_url ? $_commit_url : $gs->full_url;
> +
> +	if (defined $_commit_url) {
> +		$url = $_commit_url;
> +	} else {
> +		$url = eval { command_oneline('config', '--get',
> +			      "svn-remote.$gs->{repo_id}.commiturl") };
> +		if (!$url) {
> +			$url = $gs->full_url
> +		}
> +	}
> +
>  	my $last_rev = $_revision if defined $_revision;
>  	if ($url) {
>  		print "Committing to $url ...\n";
> -- 
> 1.6.1.3

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

* Re: [PATCH] git-svn: read the dcommit url from the config file on a per remote basis
  2009-02-23 22:45         ` Eric Wong
@ 2009-02-23 23:06           ` Junio C Hamano
  0 siblings, 0 replies; 10+ messages in thread
From: Junio C Hamano @ 2009-02-23 23:06 UTC (permalink / raw)
  To: Eric Wong; +Cc: Peter Oberndorfer, git

Eric Wong <normalperson@yhbt.net> writes:

> Peter Oberndorfer <kumbayo84@arcor.de> wrote:
>> The commit url for dcommit is determined in the following order:
>> commandline option --commit-url
>> svn.commiturl
>> svn-remote.<name>.commiturl
>> svn-remote.<name>.url
>> 
>> Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
>
>> ---
>> Now with a short documentation for svn.commiturl.
>> I hope the wording is OK.
>
> Thanks Peter, the wording is fine.
>
> Acked and pushed out to git://git.bogomips.org/git-svn

Will pull before I'll go into the integration mode tonight for 1.6.2-rc2.
Thanks.

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

end of thread, other threads:[~2009-02-23 23:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-19 18:30 [PATCH] git-svn: try to read the dcommit url from the config file Peter Oberndorfer
2009-02-19 18:47 ` git svn dcommit difficulties/feature request Peter Oberndorfer
2009-02-20 12:59   ` Kevin Menard
2009-02-21 12:12   ` Eric Wong
2009-02-21 12:08 ` [PATCH] git-svn: try to read the dcommit url from the config file Eric Wong
2009-02-22 21:41   ` Peter Oberndorfer
2009-02-23  2:05     ` Eric Wong
2009-02-23 11:02       ` [PATCH] git-svn: read the dcommit url from the config file on a per remote basis Peter Oberndorfer
2009-02-23 22:45         ` Eric Wong
2009-02-23 23:06           ` Junio C Hamano

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