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

Referring to other repositories

From
MMaaartin <grajcar1@seznam.cz>
Date
Dec 14, 2010, 01:03 UTC
Message-ID
<loom.20101214T011043-268@post.gmane.org>
I'm using multiple repositories corresponding to different projects. Currently, 
all the projects reside in different subdirectories of the same directory, like
work/A
work/B
work/C
There are some dependencies like B and C depending on A. Until now, my git 
knows nothing about it and it works fine, since most changes of A are 
unimportant for B and C (as A is my general purpose code which doesn't change 
much). There are three kinds of changes in A:
- unrelated changes completely irrelevant to the other projects (vast majority)
- changes made because of either B or C (sometimes)
- unrelated changes forcing updating B and/or C (very seldom)
Not keeping track about A in the other projects would be a problem if I was to 
use git bisect. Having to checkout the corresponding version of A when checking 
out an old version of B or C manually, is just an inconvenience, no real 
problem.
I know about git submodule, however IIUIC it needs the other project to become 
a subdirectory of the master, but I can hardly make A to subdirectory of both B 
and C (I'm a poor Windows user, so no symlinks). I could make copies of A as 
subdirectories, but having A thrice would be very impractical:
- I'd have to avoid modifying the copies instead of the master.
- All three versions would show up in my IDE.
- I'd have to keep them in sync.
So it looks like using submodules is no option, but I hope you tell me that I'm 
wrong.

What other possibilities are there? For the normal use, I'd be happy with git tracking the commit id of A somehow. I think I could do it by saving the output of GIT_DIR=/e/work/A git log --max-count=1 --format=format:%H in a file using a pre-commit hook. Or is there a better way?

For git bisect (which I haven't used yet but I'm going to), I'd need a way to check out the right version of A automatically, this could be done as part of the command given to git bisect run, right?

Next: Konstantin Khomoutov
Message 1 of 2 in “Referring to other repositories”
  1. MaaartinDec 14, 2010
  2. Konstantin KhomoutovDec 14, 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.