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

Re: [PATCH] sha1-name.c: for ":/", find detached HEAD commits

From
William Chargin <wchargin@gmail.com>
Date
Jul 11, 2018, 06:18 UTC
Message-ID
<CAFW+GMAP6hwU1frm-FUVqx4pokpSQajWz7N6mGtMC-EO+01m2Q@mail.gmail.com>
In-Reply-To
<xmqqwou26hcv.fsf@gitster-ct.c.googlers.com>
> we care about reachability only from the detached HEAD here, so this
> must _not_ use test_commit, which creates an extra tag.
Right. I can add a comment to that effect.
> Please avoid unnecessary reflowing of earlier lines of the paragrpah
> when the only change is to insert "or from HEAD" in the middle of its
> fourth line.
Sure: I'll make that change. (My intent was to incrementally clean up an
area already under change, but I'm happy to instead make only the
minimal change.)
> Also, I am not sure if "or from HEAD" is even needed when we say
> "from ANY ref" already, as we count things like HEAD as part of the
> ref namespace.

My two cents: with the docs as is, I wasn't sure whether HEAD was intended to count as a ref for this purpose. The gitglossary man page defines a ref as a "name that begins with refs/" (seemingly excluding HEAD), though it later says that HEAD is a "special-purpose ref". In my opinion, the change adds clarity without any particular downside---but I'm happy to revert it if you'd prefer. I'd also be happy to change the wording to something like "any ref, including HEAD" if we want to emphasize that HEAD really is a ref.

> We are interested in seeing that ":/string" is understood as a valid
> object name, and this is not limited to "log" at all.

Indeed. I was a bit surprised for the same reason (I expected the tests to be using `rev-parse`), but I agree that it's probably best to keep the existing structure to minimize churn.

---

After reaching consensus on the change to the docs, should I send in a [PATCH v2] In-Reply-To this thread? Peff, should I add your Signed-off-by to the commit message, or is that not how things are done?

Best, WC

Previous: Junio C HamanoNext: Jeff King
Message 4 of 19 in “sha1-name.c: for ":/", find detached HEAD commits”
  1. sha1-name.c: for ":/", find detached HEAD commitsWilliam Chargin, Jul 10, 2018
  2. Jeff KingJul 10, 2018
  3. Junio C HamanoJul 10, 2018
  4. William CharginJul 11, 2018
  5. Jeff KingJul 11, 2018
  6. Junio C HamanoJul 11, 2018
  7. Duy NguyenJul 11, 2018
  8. Jeff KingJul 11, 2018
  9. Junio C HamanoJul 11, 2018
  10. Duy NguyenJul 11, 2018
  11. William CharginJul 11, 2018
  12. sha1-name.c: for ":/", find detached HEAD commitsWilliam Chargin, Jul 12, 2018
  13. Jeff KingJul 12, 2018
  14. Junio C HamanoJul 12, 2018
  15. William CharginJul 12, 2018
  16. Junio C HamanoJul 12, 2018
  17. William CharginJul 12, 2018
  18. Jeff KingJul 13, 2018
  19. William CharginJul 13, 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.