git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 1/5] pull: rename pull.rename to pull.mode

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Sep 9, 2013, 22:49 UTC
Message-ID
<CAMP44s1OyST3S1HEdS38WPsjq6w9SekuwT4DRUgVvduATox9tw@mail.gmail.com>
In-Reply-To
<522E3C6A.3070409@bbn.com>
On Mon, Sep 9, 2013 at 4:23 PM, Richard Hansen <rhansen@bbn.com> wrote:
Show 5 quoted lines
> 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.
Probably, but Junio is not picking this patch anyway.
Show 77 quoted lines
>> 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.<name>.mergeoptions::
>>       option values containing whitespace characters are currently not
>>       supported.
>>
>> -branch.<name>.rebase::
>> -     When true, rebase the branch <name> 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.<name>.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.<name>::
>>       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.<name>.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.<name>.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.<name>.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.<name>.rebase are deprecated."
>> +             echo "Please use pull.mode and branch.<name>.pullmode instead."
>> +     fi
>>  fi
>>  dry_run=
>>  while :
>
> These deprecation warning messages should be written to stderr, and
> should probably be prefixed with "WARNING: ".
Is there any deprecation warning that works this way?
-- 
Felipe Contreras
Previous: Richard HansenNext: Jeff King
Message 4 of 24 in “Preparation for non-ff pulls by default”
  1. 0/5 Preparation for non-ff pulls by defaultFelipe Contreras, Sep 9, 2013
  2. 1/5 pull: rename pull.rename to pull.modeFelipe Contreras, Sep 9, 2013
  3. Richard HansenSep 9, 2013
  4. Felipe ContrerasSep 9, 2013
  5. Jeff KingSep 10, 2013
  6. Felipe ContrerasSep 10, 2013
  7. Jeff KingSep 10, 2013
  8. Matthieu MoySep 10, 2013
  9. Felipe ContrerasOct 11, 2013
  10. Richard HansenOct 12, 2013
  11. Jeff KingOct 12, 2013
  12. Felipe ContrerasOct 12, 2013
  13. Jeff KingOct 12, 2013
  14. Felipe ContrerasOct 12, 2013
  15. Richard HansenOct 12, 2013
  16. Felipe ContrerasOct 12, 2013
  17. Richard HansenSep 19, 2013
  18. Felipe ContrerasOct 11, 2013
  19. Junio C HamanoSep 10, 2013
  20. 2/5 pull: refactor $rebase variable into $modeFelipe Contreras, Sep 9, 2013
  21. 3/5 pull: add --merge optionFelipe Contreras, Sep 9, 2013
  22. 4/5 pull: add merge-ff-only optionFelipe Contreras, Sep 9, 2013
  23. 5/5 pull: add warning on non-ff mergesFelipe Contreras, Sep 9, 2013
  24. Felipe ContrerasSep 9, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.