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

Re: [PATCH] git-diff.txt: prefer not using <commit>..<commit>

From
Elijah Newren <newren@gmail.com>
Date
Mar 20, 2019, 14:21 UTC
Message-ID
<CABPp-BGymk=FLvC7m4WB3vVi3oObgNkOPQ_TeOWEC=L0kZaRsA@mail.gmail.com>
In-Reply-To
<87mulsdmsi.fsf@evledraar.gmail.com>

On Mon, Mar 18, 2019 at 12:07 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 6 quoted lines
> On Mon, Mar 18 2019, Elijah Newren wrote:
>
> > On Sun, Mar 17, 2019 at 6:41 AM Ævar Arnfjörð Bjarmason
> > <avarab@gmail.com> wrote:
> >> On Sun, Mar 17 2019, Denton Liu wrote:
> >>
Show 8 quoted lines
> Some of this thread's confusing, and on re-reading I see my reply hasn't
> helped much.
>
> To clarify. There's at least these things to consider:
>
> 1. What should the semantics of .. or ... be?
> 2. What semantics (regardless of syntax) should we recommend for common cases?
> 3. Depending on #1 and #2, can we make our docs less confusing?

That's a good framework; thanks for clarifying. Junio has weighed in already, but there were two other things I thought I'd still comment on. First, I think this list could use another item, related to #3:

4. Given backward compatibility and existing use-case constraints, is
there at least a way to warn users of possible confusion besides just
the docs?

I suggested one answer elsewhere in this thread (cf. CABPp-BEy9nN=aV8Y+ueYqv299umHoF2E=8D7heJARM4Qa7P5JQ@mail.gmail.com); not sure what others think of it yet.

Show 10 quoted lines
> Anecdotally I've seen ".." in all forms be *way* more common among
> users, even though if you sat them down and explained to them what it
> does v.s. "..." they'd usually say they wanted the latter.
>
> I did some brief scraping of .bash_history on one of our big shared
> servers just now that has a lot of users (100-200) using git for daily
> development. I've got many pages of things like "@{u}..",
> "<tag1>..<tag2>", "<rev>.. -- <path>" etc. against just a couple of uses
> of "...". The "<rev1> <rev2>" form gets a bit of use, but maybe 1/2 of
> "..".

Wow, that is extremely surprising to me. I have no mechanism to access any such data (nor any mechanism for pushing new git versions out to users other than sending out an email about new upstream releases and asking them to update). So, I did the next best thing and sent out a poll to developers (all of whom use git daily); there's a self-selection bias in the responses that probably tilts away from novice users, but it's all I had:

Which do you use the most?
1.`git diff A B`    `11`
2. `git diff A..B`    `2`
3. `git diff A...B`
4. I never use any of these    `5`

The responses were 11 for #1 (with a number expressing in follow-ups that it was the only form of these three they ever used, though some still used other forms sometimes), 2 for #2 (one of whom responded to requests for more details and found out he was using it wrong and that he could save a character by using form #1 in cases where A was the merge base, which he was happy about), 0 for #3, and 5 for #4.

That was still a lot more voting for the '..' form than I expected, but still far less than what you have seen. I wonder if there's a regional difference?

Previous: Junio C HamanoNext: Elijah Newren
Message 13 of 16 in “git-diff.txt: prefer not using <commit>..<commit>”
  1. git-diff.txt: prefer not using <commit>..<commit>Denton Liu, Mar 17, 2019
  2. Duy NguyenMar 17, 2019
  3. Junio C HamanoMar 18, 2019
  4. Denton LiuMar 19, 2019
  5. Johannes SchindelinMar 21, 2019
  6. Ævar Arnfjörð BjarmasonMar 17, 2019
  7. Duy NguyenMar 17, 2019
  8. Ævar Arnfjörð BjarmasonMar 17, 2019
  9. Junio C HamanoMar 18, 2019
  10. Elijah NewrenMar 18, 2019
  11. Ævar Arnfjörð BjarmasonMar 18, 2019
  12. Junio C HamanoMar 19, 2019
  13. Elijah NewrenMar 20, 2019
  14. Elijah NewrenMar 18, 2019
  15. Denton LiuMar 20, 2019
  16. Elijah NewrenMar 21, 2019

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.