From: Peter Oberndorfer <kumbayo84@arcor.de>
To: git@vger.kernel.org
Subject: [PATCH] git-svn: try to read the dcommit url from the config file
Date: Thu, 19 Feb 2009 19:30:10 +0100 [thread overview]
Message-ID: <200902191930.10139.kumbayo84@arcor.de> (raw)
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
next reply other threads:[~2009-02-19 18:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-19 18:30 Peter Oberndorfer [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200902191930.10139.kumbayo84@arcor.de \
--to=kumbayo84@arcor.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).