From: Richard Hansen Date: Mon, 09 Sep 2013 21:23:54 GMT Subject: Re: [PATCH v3 1/5] pull: rename pull.rename to pull.mode Message-ID: <522E3C6A.3070409@bbn.com> In-Reply-To: <1378689796-19305-2-git-send-email-felipe.contreras@gmail.com> On 2013-09-08 21:23, Felipe Contreras wrote: > The old configurations still work, but get deprecated. Should some tests for the deprecated configs be added? We wouldn't want to accidentally break those. > diff --git a/Documentation/config.txt b/Documentation/config.txt > index ec57a15..9489a59 100644 > --- a/Documentation/config.txt > +++ b/Documentation/config.txt > @@ -760,11 +760,11 @@ branch..mergeoptions:: > option values containing whitespace characters are currently not > supported. > > -branch..rebase:: > - When true, rebase the branch on top of the fetched branch, > - instead of merging the default branch from the default remote when > - "git pull" is run. See "pull.rebase" for doing this in a non > - branch-specific manner. > +branch..pullmode:: > + When "git pull" is run, this determines if it would either merge or > + rebase the fetched branch. The possible values are 'merge' and > + 'rebase'. See "pull.mode" for doing this in a non branch-specific > + manner. > + > *NOTE*: this is a possibly dangerous operation; do *not* use > it unless you understand the implications (see linkgit:git-rebase[1] > @@ -1820,11 +1820,11 @@ pretty.:: > Note that an alias with the same name as a built-in format > will be silently ignored. > > -pull.rebase:: > - When true, rebase branches on top of the fetched branch, instead > - of merging the default branch from the default remote when "git > - pull" is run. See "branch..rebase" for setting this on a > - per-branch basis. > +pull.mode:: > + When "git pull" is run, this determines if it would either merge or > + rebase the fetched branch. The possible values are 'merge' and > + 'rebase'. See "branch..pullmode" for doing this in a non > + branch-specific manner. > + > *NOTE*: this is a possibly dangerous operation; do *not* use > it unless you understand the implications (see linkgit:git-rebase[1] Somewhere something should mention what the default values are (branch..pullmode defaults to pull.mode and pull.mode defaults to merge). > diff --git a/git-pull.sh b/git-pull.sh > index f0df41c..de57c1d 100755 > --- a/git-pull.sh > +++ b/git-pull.sh > @@ -43,10 +43,24 @@ log_arg= verbosity= progress= recurse_submodules= verify_signatures= > merge_args= edit= > curr_branch=$(git symbolic-ref -q HEAD) > curr_branch_short="${curr_branch#refs/heads/}" > -rebase=$(git config --bool branch.$curr_branch_short.rebase) > +mode=$(git config branch.${curr_branch_short}.pullmode) > +if test -z "$mode" > +then > + mode=$(git config pull.mode) > +fi > +test "$mode" == 'rebase' && rebase="true" > if test -z "$rebase" > then > - rebase=$(git config --bool pull.rebase) > + rebase=$(git config --bool branch.$curr_branch_short.rebase) > + if test -z "$rebase" > + then > + rebase=$(git config --bool pull.rebase) > + fi > + if test "$rebase" = 'true' > + then > + echo "The configurations pull.rebase and branch..rebase are deprecated." > + echo "Please use pull.mode and branch..pullmode instead." > + fi > fi > dry_run= > while : These deprecation warning messages should be written to stderr, and should probably be prefixed with "WARNING: ". -Richard