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

Re: The original file that was split in 2 other files, is there a way in git to see what went where?

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 23, 2018, 18:37 UTC
Message-ID
<xmqq8tcoifpa.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20180123165545.GI13068@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 17 quoted lines
> On Mon, Jan 22, 2018 at 10:22:21PM -0500, Aleksey Bykov wrote:
>
>> I am a code reviewer, I have a situation in GIT:
>> 
>> - before: a.txt
>> 
>> Then a developer decided to split the content of a.txt into 2 files
>> and add a few changes all in one commit:
>> 
>> - after: b.txt + few changes and c.txt + few changes
>> ...
> For seeing which line came from where, you might try "git blame -C",
> which will cross file boundaries looking for the source of lines.
> ...
> And finally, if you're going to do a lot with "git blame", I'd look into
> the "tig" tool as a prettier interface. You should be able to do "tig
> blame -C ..." in the same way.

All excellent guides. "blame" is good at explaining where things came from, but not as good at explaining, starting from an old state, where things went. "blame --reverse" does a decent job within the constraints its output format has, but not quite ideal.

Previous: Jeff King
Message 4 of 4 in “Re: The original file that was split in 2 other files, is there a way in git to see what went where?”
  1. Aleksey BykovJan 23, 2018
  2. Jonathan TanJan 23, 2018
  3. Jeff KingJan 23, 2018
  4. Junio C HamanoJan 23, 2018

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.