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

Re: git filter-branch and superproject

From
Boaz Harrosh <bharrosh@panasas.com>
Date
Dec 16, 2008, 13:01 UTC
Message-ID
<4947A68C.1010503@panasas.com>
In-Reply-To
<loom.20081216T114923-354@post.gmane.org>
Sergio Callegari wrote:
Show 23 quoted lines
> Hi,
> 
> once a sub-project has been rewritten by filter branch, there is a problem with
> references in superproject.
> 
> This is obviously a case where something "has been published" so filter-branch
> is not a good idea.  However, super-projects are a very special case of
> publication since they might be "in full control" of whom did the rewriting of
> their submodules.
> 
> Is there a way to filter branch the superproject so that whatever commit is
> referenced that is in refs/original/something in the subproject gets updated to
> the corresponding rewritten commit (or an error is given if such a
> correspondance does not exist)?
> 
> Namely, can filter-branch on the subproject deliver a "commit conversion table"
> that can then be fed to a filter-branch in a superproject?  
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

If I recall correctly, submodule was recently enabled to reference a soft label, like a branch name, instead of an hard UID. Look it up in the newest git.

But your post brings up another concern. The HEAD referenced by the superproject does not have any hold in the subproject. So if the subproject under-gone a git-gc the reference UID might disappear, as in your case. I wish the git-submodule command would create a TAG or BRANCH in the subproject of all referenced HEADs, so they will not disappear in future maintenance of the subproject tree. (And it could be very informative when viewing in gitweb). The subproject TAG name could, for example, be the commit and date of the superproject's submodule commit.

Boaz
Previous: Sergio Callegari
Message 2 of 2 in “git filter-branch and superproject”
  1. Sergio CallegariDec 16, 2008
  2. Boaz HarroshDec 16, 2008

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.