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

Re: DWIM .git repository discovery

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 26, 2012, 04:21 UTC
Message-ID
<7v7grhv2fu.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8DOtPWgkq=KSHCb=J3qg4o1aPaLo4aj7U5f_qa+kCCipQ@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 5 quoted lines
> I often find myself attempting to examine another repository,
> especially in projects that are closely related but put in different
> git repos. It's usually just a diff or log command
>
> git log --patch ../path/to/another/repo/path/to/file.c
I personally do not think it is _too_ bad to internally do
	(cd ../path/to/another/repo/path/to &&
	 git log --patch file.c)

but I doubt it is worth the numerous implications (I am not talking about implementation complexity at all, but the conceptual burden).

For example, where in the working tree of the other project should the command run? The output from "log -p" happens to be always relative to the top of the working tree, but that does not necessarily hold true for other subcommands.

A worse thing is that there is an oddball case "diff[ --no-index]" that changes behaviour depending on the pathspec points at inside or outside the repository.

I think that this is a road to insanity; anybody who thinks along this line is already on the other side of the line, I would have to say ;-).

Previous: Nguyen Thai Ngoc DuyNext: Michael J Gruber
Message 2 of 7 in “DWIM .git repository discovery”
  1. Nguyen Thai Ngoc DuySep 26, 2012
  2. Junio C HamanoSep 26, 2012
  3. Michael J GruberSep 26, 2012
  4. Nguyen Thai Ngoc DuySep 26, 2012
  5. Drew NorthupSep 27, 2012
  6. Nguyen Thai Ngoc DuySep 27, 2012
  7. Junio C HamanoSep 27, 2012

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.