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

Re: Submodules or similar for exercise/exam management

From
SRSeth Robertson <in-gitvger@baka.org>
Date
Nov 18, 2010, 16:36 UTC
Message-ID
<201011181636.oAIGaRxm021543@no.baka.org>
In-Reply-To
<201011181109.08345.trast@student.ethz.ch>
In message <201011181109.08345.trast@student.ethz.ch>, Thomas Rast writes:
    The requirements we came up with are roughly:
    1) commit across all sub-repos at the same time (atomicity nice but
       optional)
      1b) tag across all sub-repos
    2) do recursive clone/update of one super-repo easily
    3) never need to be aware of repo boundaries or manipulate sub-repo
    4) sanely cope with branches etc. in case the user wants them

This is exactly the sort of situation I wrote gitslave for. http://gitslave.sf.net I have a superproject of many subprojects where I want to perform the same git operation on all of them at the same time as if it was one giant repository (without the drawbacks of a giant repository while losing as few as the benefits as possible).

It does not perform atomic commits across sub-repos, but otherwise handles 1 and 1b. 2 and 4 are handled as well. 3 is mostly handled, and by mostly, I mean if you get, for instance, a merge conflict in the superproject or the subproject, you would need to resolve that using the normal git commands and then typically retry the gitslave command. gitslave does not prevent you from using any git command in any way you might desire, it simply allows you to use "gits" instead of "git" when you want your command to run over all repos.

    A sample workflow might be:
      foo clone git@example.com/some/super/repo
      # time passes
      cd repo
      foo update
      # work
      foo status
      foo diff
      foo commit -m 'one message fits all'
      # possibly, but this could also be commit --no-push instead
      foo push
In the gitslave world, this would be done:

git clone git@example.com/some/super/repo cd repo gits checkout master # time passes gits pull # work gits status gits diff gits commit -a -m 'one message fits none' # I am not familiar with the "git commit --no-push" option gits push

    Merges are expected to be rare but would happen every so often.

gits checkout featurebranch # work gits commit -a -m 'features are misunderstood' gits checkout master gits merge featurebranch gits tag v1.0 -a -m "feature available" gits push gits push --tags

    Has this been done before?  Or do we need to hack up a new wrapper
    around submodules?

Hopefully gitslave will work for you (or could be modified to work for you). It is not perfect but has been working well enough for a team of developers for over two years.

					-Seth Robertson
Previous: Thomas RastNext: Thomas Rast
Message 2 of 7 in “Submodules or similar for exercise/exam management”
  1. Thomas RastNov 18, 2010
  2. Seth RobertsonNov 18, 2010
  3. Thomas RastNov 22, 2010
  4. Jens LehmannNov 18, 2010
  5. Junio C HamanoNov 18, 2010
  6. Jonathan NiederNov 18, 2010
  7. Thomas RastNov 22, 2010

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.