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

Re: [PATCH] submodule: Add --force option for git submodule update

From
Nicolas Morey-Chaisemartin <devel-git@morey-chaisemartin.com>
Date
Mar 31, 2011, 18:13 UTC
Message-ID
<4D94C449.1040903@morey-chaisemartin.com>
In-Reply-To
<4D94BCCC.7090808@web.de>
On 03/31/2011 07:41 PM, Jens Lehmann wrote:
Show 8 quoted lines
> We are in a similar situation at my dayjob, but we handled the issue in
> a different way. We were reluctant to check in generated files into our
> repository, so we decided to distribute them via zip files. We have a
> beefy build machine which builds and tests master over night and if
> everything went ok it zips the whole work tree including .git directory,
> build artifacts and submodules into one file. Then each developer just
> has to unpack this file, fetch from the git server and he is all set.
> 

We have something a bit similar for cross project dependencies. We just store in project a file with the SHA1 to another one and we have a server which stores all the packages ever generated and a sqliteDB to have the SHA1 <=> package relation. It works but it requires to add DB files, CGI script to update/query the DB... So we limited this only to a few dependencies between otherwise separated projects. For the rest, it's just easier to commit generated small files.

Show 7 quoted lines
> 
> Me too agrees that being able to reset a whole work tree including all
> submodules recursively makes a lot of sense. But I would not be so happy
> seeing this functionality being added to the git-submodule.sh script, as
> I believe it belongs into "git reset", so you'll just have to do a "git
> reset --hard --recurse-submodules" and you are done.
> 

Yes it is probably easier and clearer for everyone to put it into the dedicated command. This way you know it does the same thing it usually does except on all submodules. Thinking about "git submodule reset" I started wondering about what should be done for indexes, checked out files, ignored files and so on, and whatever is chosen it will confuse pretty much everyone. Also a git clean --recurse-submodules would be nice !

Show 6 quoted lines
> In the branch "git-checkout-recurse-submodules" in my github repo (which
> is at https://github.com/jlehmann/git-submod-enhancements) you can see a
> preliminary implementation of that (it works and I use it every day at my
> job. It has recursion enabled by default at the moment yet still might
> overwrite local changes even if it shouldn't, so use with care ;-).
> 

I'll have a look at it. For the moment I use a bash script which recurse in all submodules doing git clean and git checkout all other the place (it also works with old gits that lack all the foreach and --recursive features)

>> But I also still think having a --force option to update does too, in the way Jens proposed it (only on submodule that actually needed a checkout), don't you?
> 
> Yes, I still think it makes sense to add the "-f" flag to submodule update.
> 
If Junio agrees with the idea, I'll repost a much simpler version of the path that just add -f for the submodules that needs it.
Nicolas Morey-Chaisemartin
Previous: Jens Lehmann
Message 9 of 9 in “submodule: Add --force option for git submodule update”
  1. submodule: Add --force option for git submodule updateNicolas Morey-Chaisemartin, Mar 30, 2011
  2. Jens LehmannMar 30, 2011
  3. Nicolas Morey-ChaisemartinMar 30, 2011
  4. Jens LehmannMar 30, 2011
  5. Nicolas Morey-ChaisemartinMar 30, 2011
  6. Junio C HamanoMar 30, 2011
  7. Nicolas Morey-ChaisemartinMar 31, 2011
  8. Jens LehmannMar 31, 2011
  9. Nicolas Morey-ChaisemartinMar 31, 2011

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.