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

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

From
Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Date
May 5, 2011, 18:02 UTC
Message-ID
<BANLkTimD7byL=rgy79BWFT3vqKpzv9aNOQ@mail.gmail.com>
In-Reply-To
<7v1v0ddhbz.fsf@alter.siamese.dyndns.org>
On Thu, May 5, 2011 at 4:14 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> "Mikhail T." <mi+thun@aldan.algebra.com> writes:
>
>> On 04.05.2011 17:02, Junio C Hamano wrote:
>>> Well, if you come from the mindset that a "file" has an identity (hence
>>> there is a distinction between "This file used to be called A and at one
>>> point was renamed to B which is the name we see today" and "Some time ago
>>> somebody created a file B with the same contents as A and then removed A
>>> at the same time"), "copy" would not make much sense.  What identity does
>>> a new file B gets when you create it by copying from A?
>> What I want is to signify something like: "This code was obtained from
>> that in file A."
>
> I think that is what exactly "blame -C -C" gives you.
Maybe Mikhail wanted to say that if there's a git-mv as a shortcut for
  "cp old new ; rm old; add new"
then there should be a git-cp as a shortcut for
  "cp old new; add new"
Just for convenience (and symmetry with git-mv).
He did write:
> "copy" -- of an individual file -- makes just as much sense as "move" (rename).
-- 
Piotr Krukowiecki
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 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.