From b3bfa1200ad22ba55ed1531bff439d6d63ec36e5 Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Fri, 20 Oct 2006 21:48:32 +0100 Subject: [PATCH] Allow the git-pull command to be configurable This way some people can use cg-pull instead. The patch also does some clean-up in the example stgitrc file. Signed-off-by: Catalin Marinas --- TODO | 1 - examples/stgitrc | 17 ++++++++++------- stgit/config.py | 3 ++- stgit/git.py | 3 ++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index a688f9e..63047a4 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,6 @@ The TODO list before 1.0: - more regression tests - stg help should probably pipe through the $PAGER -- configurable pull command (currently uses git-pull only) - fix StGIT to run correctly in subdirectories - use a separate index for some commands (refresh, fold etc.) so that files already added/removed are not automatically checked in diff --git a/examples/stgitrc b/examples/stgitrc index 28e1879..2b85c1f 100644 --- a/examples/stgitrc +++ b/examples/stgitrc @@ -11,14 +11,14 @@ # Set to 'yes' if you don't want to use the 'resolved' command. # 'refresh' will automatically mark the conflicts as resolved -autoresolved: no +#autoresolved: no -smtpserver: localhost:25 +#smtpserver: localhost:25 #smtpuser: username #smtppassword: password -# delay between messages in seconds (defaults to 2) -#smtpdelay: 2 +# delay between messages in seconds (defaults to 5) +#smtpdelay: 5 # stg will look for this first, then look for the EDITOR environmental # variable, then default to using 'vi' @@ -27,11 +27,14 @@ smtpserver: localhost:25 # this value overrides the default PAGER environment variable #pager: ~/share/stgit/contrib/diffcol.sh +# GIT pull command (should take the same arguments as git-pull) +#pullcmd: git-pull + # The three-way merge tool. Note that the 'output' file contains the # same data as 'branch1'. This is useful for tools that do not take an # output parameter -merger: diff3 -L current -L ancestor -L patched -m -E \ - "%(branch1)s" "%(ancestor)s" "%(branch2)s" > "%(output)s" +#merger: diff3 -L current -L ancestor -L patched -m -E \ +# "%(branch1)s" "%(ancestor)s" "%(branch2)s" > "%(output)s" # Interactive three-way merge tool. It is executed by the 'resolved # --interactive' command @@ -42,7 +45,7 @@ merger: diff3 -L current -L ancestor -L patched -m -E \ # "%(branch1)s" "%(branch2)s" "%(ancestor)s" nil "%(output)s")' # Leave the original files in the working tree in case of a merge conflict -keeporig: yes +#keeporig: yes # Extensions for the files involved in a three-way merge (ancestor, # current, patched) diff --git a/stgit/config.py b/stgit/config.py index c404c64..f9ea074 100644 --- a/stgit/config.py +++ b/stgit/config.py @@ -29,7 +29,8 @@ config = ConfigParser.RawConfigParser() config.add_section('stgit') config.set('stgit', 'autoresolved', 'no') config.set('stgit', 'smtpserver', 'localhost:25') -config.set('stgit', 'smtpdelay', '2') +config.set('stgit', 'smtpdelay', '5') +config.set('stgit', 'pullcmd', 'git-pull') config.set('stgit', 'merger', 'diff3 -L current -L ancestor -L patched -m -E ' \ '"%(branch1)s" "%(ancestor)s" "%(branch2)s" > "%(output)s"') diff --git a/stgit/git.py b/stgit/git.py index 025d15d..43bdc7e 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -22,6 +22,7 @@ import sys, os, popen2, re, gitmergeonefile from stgit import basedir from stgit.utils import * +from stgit.config import config # git exception class class GitException(Exception): @@ -691,7 +692,7 @@ def pull(repository = 'origin', refspec = None): if refspec: args.append(refspec) - if __run('git-pull', args) != 0: + if __run(config.get('stgit', 'pullcmd'), args) != 0: raise GitException, 'Failed "git-pull %s"' % repository def apply_patch(filename = None, base = None): -- 2.11.0