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

Re: [PATCH 0/2] branch: introduce --current display option

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 10, 2018, 23:51 UTC
Message-ID
<20181010235108.GW432229@genre.crustytoothpaste.net>
In-Reply-To
<xmqq8t36q1k6.fsf@gitster-ct.c.googlers.com>
On Wed, Oct 10, 2018 at 05:59:05AM +0900, Junio C Hamano wrote:
Show 7 quoted lines
> I do not offhand know if we want "show the current one only" option
> that is "command mode" sitting next to "list", "delete", "rename"
> etc., or "limit the operation to the one that is currently cheked
> out".  If we want the former, the name of the option must *NOT* be
> just "current".  Have a verb in its name to avoid it from getting
> mistaken as a botched attempt to do the latter.  Somethng like
> "--show-current", "--list-current", "--display-current", etc.

I had considered sending a patch with this option spelled "--show". This is certainly a highly desired feature (hence my intent to send a patch), and I think there's room for both a porcelain (this series) and a plumbing (git rev-parse --abbrev-ref) version.

Show 12 quoted lines
> Even if we were doing the latter (i.e. focused "this is only for
> listing/showing"), if we do not want to close the door to later
> extend the concept of "current" to the former (i.e. "--show-current"
> becomes a convenience synonym for "--list --current-only") we also
> need to think about what to do with the detached HEAD state.  When
> the concept of "current" is extended to become "usually an operation
> can work on multiple branches but we are limiting it to the current
> one", detached HEAD state is conceptually "not having any current
> branch".  We could fail the operation (i.e. you told me to distim
> the branch but there is no such branch) or make it a silent no-op
> (i.e. you told me to distim no branch, so nothing happened and there
> is no error).

What I would suggest is the same thing git status shows: "HEAD (detached at...)". I'll admit it isn't strictly a branch, but that's what most people will want to see, I expect.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Rafael AscensãoNext: Ævar Arnfjörð Bjarmason
Message 6 of 9 in “branch: introduce --current display option”
  1. 0/2 branch: introduce --current display optionDaniels Umanovskis, Oct 9, 2018
  2. Junio C HamanoOct 9, 2018
  3. Eric SunshineOct 10, 2018
  4. Eric SunshineOct 10, 2018
  5. Rafael AscensãoOct 10, 2018
  6. brian m. carlsonOct 10, 2018
  7. Ævar Arnfjörð BjarmasonOct 10, 2018
  8. Daniels UmanovskisOct 10, 2018
  9. Stefan BellerOct 10, 2018

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.