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

Find commit of currently included subtree?

From
HWHilco Wijbenga <hilco.wijbenga@gmail.com>
Date
Jun 27, 2024, 17:50 UTC
Message-ID
<CAE1pOi2ia9DTo6XkHF7-D7QJxiPhd6emEmRz+ZoQ1iUyiNJtPA@mail.gmail.com>
Hi all,

I have a subtree (from repo "Tools") included in our Git repo ("App") using "git subtree ...". This is all working fine.

The next step is to automate checking whether that subtree (in "App") needs to be updated. Checking the remote "Tools" repo for its latest commit is easy with "git ls-remote" but I did not find an (obvious) way to check what subtree is currently part of our repo ("App").

It looks like I could parse the message of the commit where the subtree was last updated. It contains a line like "git-subtree-split: 1234..cdef" that appears to match the included commit in "Tools". That seems rather fragile and relatively complex.

Or I could just run "git subtree" and parse its output (as it seems to notice if there is nothing to do)?

Any suggestions for a better/simpler way?

Cheers, Hilco

Message 1 of 1 in “Find commit of currently included subtree?”
  1. Hilco WijbengaJun 27, 2024

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.