all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: Eli Zaretskii <eliz@gnu.org>, Tom Tromey <tom@tromey.com>,
	68183@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
Subject: bug#68183: 28.3; vc-dir fails when I have a certain branch checked out
Date: Sat, 16 Mar 2024 18:56:32 +0100	[thread overview]
Message-ID: <87zfuyrrfz.fsf@gmail.com> (raw)
In-Reply-To: <e7a8ed73-f5a9-4f4a-983a-91707076ecfc@gutov.dev> (Dmitry Gutov's message of "Fri, 15 Mar 2024 04:57:08 +0200")

Dmitry Gutov <dmitry@gutov.dev> writes:

> Sorry about the late reply.

(Not at all, thanks for taking a look 🙏)

>> FWIW, the current patch will show
>>      Branch     : vc-dir-tracking-branch
>>      Tracking   : origin/master
>>      Remote     :https://git.savannah.gnu.org/git/emacs.git
>> for my checkout of this work-in-progress patch, and
>>      Branch     : vc-dir-bug
>>      Tracking   : master
>>      Remote     : none (tracking local branch)
>> for a checkout made following Tom's recipe, and
>>      Branch     : trunk
>> for a fresh 'git init' with just a default branch.
>
> IIUC you're adding the new "Tracking" header to the output? That seems like it should be helpful.
>
> Is there a way that we could/should optimize the display? I.e., I guess the most common case will be something like:
>
>       Branch     : foo-bar
>       Tracking   : origin/foo-bar

Right, the current patch indeed shows this for a common-case clone of
the Emacs repo:

    VC backend : Git
    Working dir: ~/src/emacs/master/
    Branch     : master
    Tracking   : origin/master
    Remote     : https://git.savannah.gnu.org/git/emacs.git

> which is not bad, but might be less useful than indicating that the current branch does not track anything (and so the next 'git push' should come with '-u'), or tracks a differently named branch. It might be more ergonomic to emphasize "irregular" scenarios and maybe even save on the extra line in the "common" one.

Good food for thought.

Re. optimizing the display (which I interpret as reducing redundant
information): as someone who often works with multiple remotes, seeing
"Branch: FOO ; Tracking: origin/FOO" is actually useful, so I wouldn't
want to remove the "tracking" bit unconditionally.  OTOH it could surely
be condensed to a single line, say

    Branch     : master (tracking: origin/master)

Likewise, in the local-tracking-branch case, we could go from

    Branch:    : vc-dir-bug
    Tracking   : master
    Remote     : none (tracking local branch)

to just

    Branch:    : vc-dir-bug (tracking: local master)

Re. emphasizing irregular scenarios, specifically those where 'git push'
will require '-u': I like the idea, but I am wary of us getting lost in
the weeds second-guessing Git's intentions.  E.g. even when
branch.foo.merge and branch.foo.remote are unset, 'git push' can still
be called without '-u' if push.default is 'current' and
remote.pushDefault is set (whereas 'git pull' will fail).

> Just a thought. Not something that needs to be addressed right now. And I might as well be off the mark here.

I agree it's worth thinking about.  The Right Solution™ would probably
come with user options to let users fine-tune which details they care
about?  It would be interesting to survey Git UIs to see how they
approach this (FWIW I am partial to Magit's presentation, but I have not
studied how it handles all the corner cases we considered).

>>> * maybe the new header deserves a NEWS entry.
>> Maybe?
>
> It wouldn't hurt. Up to you.
>
> Anyway, I think the patch is good to go. Please feel free to install it; whatever cosmetic changes we might like to add could be done later.

ACK.  I might go a head and install then (after polishing the changelog,
i.e. re-filling and scrubbing Unicode ellipses) in the spirit of getting
the original issue fixed; perhaps worth holding off on the NEWS entry
until we decide how exactly things should look.





  reply	other threads:[~2024-03-16 17:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-31 18:59 bug#68183: 28.3; vc-dir fails when I have a certain branch checked out Tom Tromey
2023-12-31 19:34 ` Eli Zaretskii
2023-12-31 20:14   ` Tom Tromey
2024-01-03  9:46     ` Kévin Le Gouguec
2024-02-12  8:08       ` Kévin Le Gouguec
2024-02-14 19:56         ` Kévin Le Gouguec
2024-03-13 20:03           ` Kévin Le Gouguec
2024-03-15  2:57           ` Dmitry Gutov
2024-03-16 17:56             ` Kévin Le Gouguec [this message]
2024-03-17  1:06               ` Dmitry Gutov
2024-03-17 18:09                 ` Kévin Le Gouguec
2024-03-18 15:26                   ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zfuyrrfz.fsf@gmail.com \
    --to=kevin.legouguec@gmail.com \
    --cc=68183@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.