all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
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: Mon, 18 Mar 2024 17:26:11 +0200	[thread overview]
Message-ID: <06a946b4-b06a-4e10-93d5-b6d6b8bd9fcf@gutov.dev> (raw)
In-Reply-To: <87ttl43f2x.fsf@gmail.com>

On 17/03/2024 20:09, Kévin Le Gouguec wrote:

>> I would say that the local-tracking scenario is a minority, and so it's not as important to optimize, but the above makes sense. But the word "local" is very close to "master", while the latter is a special string which should probably somehow stand out. So the "unoptimized" version might still have its advantages:
>>
>>        Branch:    : vc-dir-bug (tracking master)
>>        Remote     : none (local branch)
> 
> That looks sensible.  If I were to argue in favor of keeping "local"
> juxtaposed to the tracking branch, I'd say that in the _absence_ of an
> explicit qualifier in "Branch: vc-dir-bug (tracking master)", my brain
> might "default" to assuming we are tracking the remote "master"; a
> solution to let branch names stand out might then be faces:
> e.g. vc-git-log-view-mode paints them with change-log-list…
> 
> But I don't know if it's a very powerful argument.

I figured that when "local" is on the next line already, it's easy 
enough to notice. Anyway, it's up to you, I think.

>>>> 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).
>>
>> Magit, meaning just one line for Head: and another for Merge:?
> 
> So, given
> 
> 𝒷   ≔ current branch
> 𝓂   ≔ branch.𝒷.merge
> 𝓇   ≔ branch.𝒷.remote
> 𝓅   ≔ branch.𝒷.pushRemote or remote.pushDefault
> 
> By default, magit-status shows:
> 
> "Head:"                 𝒷, or the current commit when detached
> "Merge:" (or "Rebase:") 𝓇/𝓂, or just 𝓂 if 𝓇 = "."
> "Push:"                 𝓅/𝒷, appending "does not exist" if applicable

So Magit also prints just "master" is it's a local tracking branch and 
something like "origin/master" when it belongs to a remote? Going with 
that approach, we'd seem justified to print

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

in the former case and

       Branch:    : vc-dir-bug (tracking origin/master)

in the latter.

> (And another header related to tags I'm going to ignore for now)
> 
> Of note, Magit offers an option (magit-status-headers-hook) to let users
> control which of these (and more) to display.
> 
> One of the available headers that is disabled by default shows
> 
> "Remote: ℛ <remote.ℛ.url>"
> 
> where ℛ is 𝓇, or "origin" if this branch's remote is unset or ".", or
> "the first remote in alphabetic order" if "origin" does not exist.

Meaning it prepends the remote's url with remote's name, if that line is 
configured to be shown. We could do that too.

> (
>    Also of note, IMO, is the branch-variable-configuration menu (the
>    magit-branch-configure transient), which looks like this:
> 
>        Configure vc-dir-bug
>         d branch.vc-dir-bug.description unset
>         u branch.vc-dir-bug.merge refs/heads/master
>           branch.vc-dir-bug.remote .
>         r branch.vc-dir-bug.rebase [true|false|default:false]
>         p branch.vc-dir-bug.pushRemote [hirondell|origin|savannah-rw|vps|remote.pushDefault:vps]
> 
>        Configure repository defaults
>         R pull.rebase [true|false|default:false]
>         P remote.pushDefault [hirondell|origin|savannah-rw|vps]
>         b Update default branch
> 
>        Configure branch creation
>         a m branch.autoSetupMerge [always|true|false|default:true]
>         a r branch.autoSetupRebase [always|local|remote|never|default:never]
>        __
>    (Not pictured: the currently active value in [foo|bar|baz] is
>    highlighted with a face; the keybindings on the left cycle between
>    alternatives)
> 
>    No idea how/where that would fit into VC, but golly is it a neat UI to
>    work with, so I thought it deserved a shout-out.
> )

Magit is definitely a great UI to learn Git's capabilities.

>>>>>> * 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.
>>
>> I'm okay with that.
> 
> (Pushed 📨)

Thanks!





      reply	other threads:[~2024-03-18 15:26 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
2024-03-17  1:06               ` Dmitry Gutov
2024-03-17 18:09                 ` Kévin Le Gouguec
2024-03-18 15:26                   ` Dmitry Gutov [this message]

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=06a946b4-b06a-4e10-93d5-b6d6b8bd9fcf@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=68183@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    --cc=kevin.legouguec@gmail.com \
    --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.