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

Re: [PATCH v9 2/2] pull --rebase: add --[no-]autostash flag

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 20, 2016, 02:01 UTC
Message-ID
<CAPig+cQOHAWLnDi0LmfJH2vb7mv9CABcx=dyU8DezDunZbfpVQ@mail.gmail.com>
In-Reply-To
<CA+DCAeRe4ak1Ni7CADpJdd-=+dvKTTepHY6dYNfQV3ADpz5f6Q@mail.gmail.com>
On Fri, Mar 18, 2016 at 11:17 AM, Mehul Jain <mehul.jain2029@gmail.com> wrote:
Show 24 quoted lines
> On Fri, Mar 18, 2016 at 9:54 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>>> +test_expect_success 'pull --rebase: --autostash overrides rebase.autostash' '
>>
>> Why do titles of some of the new test titles have a ":" after "rebase"
>> while other don't?
>>
>> Also, how about normalizing the titles so that the reader knows in
>> which tests rebase.autostash is 'true' and in which it is 'false'?
>> Presently, it's difficult to decipher what's being tested based only
>> on the titles.
>
> If it's so then how about the tests titles to be the following:
>
> * pull --rebase: --autostash works with rebase.autoStash set true
>
> * pull --rebase: --autostash works with rebase.autoStash set false
>
> * pull --rebase: --no-autostash works with rebase.autoStash set true
>
> * pull --rebase: --no-autostash works with rebase.autoStash set false
>
> Earlier I tried to keep it as less verbose as possible (and probably
> made it hard to decipher). Does the above titles seems short and
> informative to you? If so then I will use them instead of earlier ones.

Those are better. If I was doing it, I'd probably drop the unnecessary ":", "works with", and "set", so:

    pull --rebase --autostash & rebase.autoStash=true
    pull --rebase --autostash & rebase.autoStash=false
    pull --rebase --no-autostash & rebase.autoStash=true
    pull --rebase --no-autostash & rebase.autoStash=false
or something, but that's a very minor point.
Show 9 quoted lines
>> Finally, shouldn't you also be testing --autostash and --no-autostash
>> when rebase.autostash is not set?
>
> If rebase.autoStash is not set then config.autostash will remain zero
> through out the process. What I want to point out is that rebase.autoStash
> , if not set, is equivalent to being set false. So adding tests regarding
> "--[no-]autostash with rebase.autoStash unset" seems equivalent to tests
> " pull --rebase: --autostash works with rebase.autoStash set false" and
> "pull --rebase: --no-autostash works with rebase.autoStash set false".

Yes, but what you've described is how the current *implementation* works, whereas the tests should be checking expected *behavior*. So, while we both know that under the current implementation, checking:

    pull --rebase --autostash & rebase.autoStash unset
is the same as checking:
    pull --rebase--autostash & rebase.autoStash=false

some future change to the implementation could (accidentally) break this equivalence, and we want to protect against such breakage by checking behavior, not implementation.

Also, I forgot to mention a couple other missing tests you should add:
    * pull --autostash (without --rebase) should error out
    * pull --no-autostash (without --rebase) should error out
Previous: Mehul Jain
Message 8 of 8 in “git-pull.c: introduce git_pull_config()”
  1. 1/2 git-pull.c: introduce git_pull_config()Mehul Jain, Mar 17, 2016
  2. 2/2 pull --rebase: add --[no-]autostash flagMehul Jain, Mar 17, 2016
  3. Eric SunshineMar 18, 2016
  4. Eric SunshineMar 18, 2016
  5. Mehul JainMar 18, 2016
  6. Eric SunshineMar 20, 2016
  7. Mehul JainMar 18, 2016
  8. Eric SunshineMar 20, 2016

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.