threads / patch / 28933

patchsvn: Create config options for common args

Subject: [PATCH] svn: Create config options for common args

## tl;dr

2 messages between Nov 14, 2011 and Nov 14, 2011. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Ted Percival· Nov 14, 2011, 20:25 UTC · lore
These config options may be set to apply to all commands on the
repository in lieu of providing the command-line options each time:
  svn.localtime: --localtime
  svn.useLogAuthor: --use-log-author
  svn.addAuthorFrom: --add-author-from

Since these flags apply to multiple operations, it's easier to set them once rather than remembering to use them every time for every operation.

Signed-off-by: Ted Percival <ted.percival@quest.com>
---
 Documentation/git-svn.txt |   10 ++++++++++
 git-svn.perl              |    3 +++
 2 files changed, 13 insertions(+), 0 deletions(-)
Show changes to 2 files +13 −0

Documentation/git-svn.txt, git-svn.perl

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 34ee785..20f8edd 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -113,6 +113,9 @@ repository you cloned from, but if you wish for your local Git
 repository to be able to interoperate with someone else's local Git
 repository, either don't use this option or you should both use it in
 the same local timezone.
++
+[verse]
+config key: svn.localtime
 
 --parent;;
 	Fetch only from the SVN parent of the current HEAD.
@@ -596,12 +599,19 @@ creating the branch or tag.
 	When retrieving svn commits into git (as part of 'fetch', 'rebase', or
 	'dcommit' operations), look for the first `From:` or `Signed-off-by:` line
 	in the log message and use that as the author string.
++
+[verse]
+config key: svn.useLogAuthor
+
 --add-author-from::
 	When committing to svn from git (as part of 'commit-diff', 'set-tree' or 'dcommit'
 	operations), if the existing log message doesn't already have a
 	`From:` or `Signed-off-by:` line, append a `From:` line based on the
 	git commit's author string.  If you use this, then `--use-log-author`
 	will retrieve a valid author string for all commits.
++
+[verse]
+config key: svn.addAuthorFrom
 
 
 ADVANCED OPTIONS
diff --git a/git-svn.perl b/git-svn.perl
index e30df22..d69b0d7 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -21,6 +21,9 @@ $Git::SVN::default_repo_id = 'svn';
 $Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';
 $Git::SVN::Ra::_log_window_size = 100;
 $Git::SVN::_minimize_url = 'unset';
+$Git::SVN::_localtime = Git::config_bool('svn.localtime');
+$Git::SVN::_add_author_from = Git::config_bool('svn.addAuthorFrom');
+$Git::SVN::_use_log_author = Git::config_bool('svn.useLogAuthor');
 
 if (! exists $ENV{SVN_SSH} && exists $ENV{GIT_SSH}) {
 	$ENV{SVN_SSH} = $ENV{GIT_SSH};
-- 
1.7.7.1
Eric Wong· Nov 14, 2011, 21:46 UTC · re: Ted Percival · lore

Re: [PATCH] svn: Create config options for common args

Ted Percival <ted.percival@quest.com> wrote:
>  Documentation/git-svn.txt |   10 ++++++++++
Thanks, documentation part is very much appreciated
Show 9 quoted lines
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -21,6 +21,9 @@ $Git::SVN::default_repo_id = 'svn';
>  $Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';
>  $Git::SVN::Ra::_log_window_size = 100;
>  $Git::SVN::_minimize_url = 'unset';
> +$Git::SVN::_localtime = Git::config_bool('svn.localtime');
> +$Git::SVN::_add_author_from = Git::config_bool('svn.addAuthorFrom');
> +$Git::SVN::_use_log_author = Git::config_bool('svn.useLogAuthor');

I don't think these are needed. The read_git_config() function /should/ be checking all GIT_CONFIG equivalents of the Getopt::Long option specs. Can you verify? Thanks.

← back to recent threads