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

Re: [PATCH 3/3] hash-object doc: point to ls-files and rev-parse

From
Jeff King <peff@peff.net>
Date
May 22, 2019, 05:15 UTC
Message-ID
<20190522051523.GC29933@sigill.intra.peff.net>
In-Reply-To
<20190520215312.10363-4-avarab@gmail.com>
On Mon, May 20, 2019 at 11:53:12PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 6 quoted lines
> Amend the intro to note that it's better to ask the index about files
> already tracked by it.
> 
> I've seen uses of this in the wild where the use-case was finding
> object IDs for files found in a freshly cloned repo, i.e. something
> like "git ls-files | git hash-object --stdin-paths".

This example left me scratching my head, because it seems like such a bad way to accomplish the goal that I had trouble figuring out what the goal was in the first place.

Of course I am pretty familiar with Git, so my mindset is not necessarily the same as the average reader of the manpage. But the suggested documentation really seems to me to be warning about a convoluted use case that most people would not come up with in the first place.

And adding it in the introductory text means that people are more likely to read and be confused by it, when they are really just looking to find details on more mundane usage.

Or put another way: I could come up with a hundred bad ways to script Git, but we are probably better off enumerating the _good_ ways to do so, rather than listing the bad ways and leaving the user to figure out what's left.

So I'm mildly negative on this patch.
-Peff
Previous: Ævar Arnfjörð Bjarmason
Message 12 of 12 in “hash-object doc: small fixes”
  1. 0/3 hash-object doc: small fixesÆvar Arnfjörð Bjarmason, May 20, 2019
  2. 1/3 hash-object doc: stop mentioning git-cvsimportÆvar Arnfjörð Bjarmason, May 20, 2019
  3. Jeff KingMay 22, 2019
  4. 2/3 hash-object doc: elaborate on -w and --literally promisesÆvar Arnfjörð Bjarmason, May 20, 2019
  5. Jeff KingMay 22, 2019
  6. Jakub NarebskiMay 24, 2019
  7. Ævar Arnfjörð BjarmasonMay 24, 2019
  8. Jeff KingMay 28, 2019
  9. Junio C HamanoMay 28, 2019
  10. Junio C HamanoMay 28, 2019
  11. 3/3 hash-object doc: point to ls-files and rev-parseÆvar Arnfjörð Bjarmason, May 20, 2019
  12. Jeff KingMay 22, 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.