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

Re: questions about git-mktree

From
Junio C Hamano <gitster@pobox.com>
Date
May 10, 2009, 17:10 UTC
Message-ID
<7vvdo8zxwp.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7v63g829pg.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
> Jon Seymour <jon.seymour@gmail.com> writes:
>
>> Does git-mktree normalize the sort order of the input or take it as it
>> is? I can see  a case for having it do normalization, if it doesn't
>> already and probably for this to be the default behaviour.
>
> It does have "accumulate and qsort before writing it out", since 83f5053
> (git-mktree: reverse of git-ls-tree., 2006-02-20).
>
> This program was done as a quick hack but it is so old that I forgot all
> about it.  If you are going to use it, you may have to do some reality
> checks on it first.  For example, notice that the date above predates the
> introduction of gitlinks, so I would not be too surprised if it barfed
> when given a commit object in its input.

Heh, it does verify that the object listed exists locally in the repository, so submodules would not work in general.

I'm fixing it. You _might_ get your recursive mktree as a side effect at the end of the series, but no promises ;-)

Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 16 in “questions about git-mktree”
  1. Jon SeymourMay 10, 2009
  2. Uwe Kleine-KönigMay 10, 2009
  3. A Large Angry SCMMay 10, 2009
  4. Jakub NarebskiMay 10, 2009
  5. Junio C HamanoMay 10, 2009
  6. Junio C HamanoMay 10, 2009
  7. 0/6 Modernize mktree somewhatJunio C Hamano, May 10, 2009
  8. 1/6 build-in git-mktreeJunio C Hamano, May 10, 2009
  9. 2/6 mktree: use parse-optionsJunio C Hamano, May 10, 2009
  10. 3/6 builtin-mktree.c: use a helper function to handle one line of inputJunio C Hamano, May 10, 2009
  11. 4/6 mktree: do not barf on a submodule commitJunio C Hamano, May 10, 2009
  12. 5/6 t1010: add mktree testJunio C Hamano, May 10, 2009
  13. 6/6 mktree --missing: allow missing objectsJunio C Hamano, May 10, 2009
  14. René ScharfeMay 10, 2009
  15. Junio C HamanoMay 11, 2009
  16. Josh MicichMay 10, 2009

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.