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

Re: How to fork a file (git cp ?)

From
Jeff King <peff@peff.net>
Date
May 5, 2011, 20:01 UTC
Message-ID
<20110505200130.GB1770@sigill.intra.peff.net>
In-Reply-To
<4DC2FB0A.2090100@aldan.algebra.com>
On Thu, May 05, 2011 at 03:31:22PM -0400, Mikhail T. wrote:
Show 6 quoted lines
> On 04.05.2011 22:14, Junio C Hamano wrote:
> >I think that is what exactly "blame -C -C" gives you.
> For that to be useful, one has to suspect, the file was derived by
> copying something else... Simple "git log" will not suggest that --
> unless the commit message, that adds the new copy of a file points to
> it...

I think "git log --follow" will do what you want; it uses FIND_COPIES_HARDER.

Show 5 quoted lines
> On 05.05.2011 14:02, Piotr Krukowiecki wrote:
> >Maybe Mikhail wanted to say that if there's a git-mv as a shortcut for
> >   "cp old new ; rm old; add new"
> git-mv preserves the old's change-history in new, so it is more than
> the above, is not it?

No. The renames are detected at the time of viewing, not at the time of commit.

-Peff
Previous: Mikhail T.Next: Piotr Krukowiecki
Message 14 of 19 in “How to fork a file (git cp ?)”
  1. Mikhail T.May 4, 2011
  2. Johannes SixtMay 4, 2011
  3. Johannes SixtMay 4, 2011
  4. Stephen BashMay 4, 2011
  5. Mikhail T.May 4, 2011
  6. Øyvind A. HolmMay 4, 2011
  7. Junio C HamanoMay 4, 2011
  8. Mikhail T.May 5, 2011
  9. Junio C HamanoMay 5, 2011
  10. Piotr KrukowieckiMay 5, 2011
  11. Junio C HamanoMay 5, 2011
  12. Piotr KrukowieckiMay 5, 2011
  13. Mikhail T.May 5, 2011
  14. Jeff KingMay 5, 2011
  15. Piotr KrukowieckiMay 5, 2011
  16. Piotr KrukowieckiMay 5, 2011
  17. Jeff KingMay 5, 2011
  18. Pete HarlanMay 8, 2011
  19. Junio C HamanoMay 8, 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.