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

RE: Feature Request: Option to make "git rev-list --objects" output duplicate objects

From
Baumann, Moritz <moritz.baumann@sap.com>
Date
Mar 27, 2023, 07:02 UTC
Message-ID
<AS1PR02MB818545E563E40C5E31A02D1E948B9@AS1PR02MB8185.eurprd02.prod.outlook.com>
In-Reply-To
<xmqq4jqa3xgj.fsf@gitster.g>
Show 12 quoted lines
> I do not think there currently is such an option, and not showing
> the same object twice is pretty much fundamental in the operation of
> the command, so it is unclear what the new feature should look like.
>
> Should it also show the same commit it encounters during its history
> walk (remember, a history can have forks and merges in it) in
> duplicates if it encounters it more than once?  Should it show all
> the subtrees and blobs in the tree of each commit, even if most of
> them do not change from commit to commit?  How does the user control
> which ones are duplicated and which ones are to be visited only
> once?  How does the command line option used by the user to tell the
> command to give such a choice look like?

I was a bit brief in my description on Friday evening, due to the day & time. My naïve idea would be as follows:

The option would be called something like "--include-all-object-names" and belong to the category of options that only make sense in combination with "--objects". That name (hopefully) already explains the intended behavior:

 * commits are not duplicated
 * as before, only changed blobs / subtrees are shown, however:
 * blobs / subtrees are duplicated in the output if they were previously shown
   with a different name
> By the way, "rev-list" internally uses walking the commits
> one-by-one, anyway ;-).

I really should not write emails on Friday evening… What I meant was that I'd rather use a single call to git than one per commit.

(The previous implementation of my hook then also queried all blobs for each commit, not just the changed ones, which contributed to the bad performance.)

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 9 in “Feature Request: Option to make "git rev-list --objects" output duplicate objects”
  1. Baumann, MoritzMar 24, 2023
  2. Junio C HamanoMar 24, 2023
  3. Baumann, MoritzMar 27, 2023
  4. Junio C HamanoMar 27, 2023
  5. Jeff KingMar 24, 2023
  6. Baumann, MoritzMar 28, 2023
  7. docs: document caveats of rev-list's object-name outputJeff King, Mar 28, 2023
  8. Baumann, MoritzMar 30, 2023
  9. Jeff KingMar 28, 2023

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.