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

Re: [RFC/PATCH] Implement git-cp.

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 11, 2008, 01:30 UTC
Message-ID
<200802110230.06808.jnareb@gmail.com>
In-Reply-To
<7vzlu9uu7c.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 8 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > If you touch builtin-mv.c already, why not just move cmd_cp() in there?  
> > It's not like it would be the first cmd_*() function living in the same 
> > file as other cmd_*() functions.
> 
> Why do we even want "git-cp", especially when git-mv and git-rm
> are already pretty much redundant commands?

git-rm is not redundant: without it how we could easily un-add a file (without resorting to porcelain or tricks). I think it is also safer that ordinary rm (check for being up-to-date, i.e. for modified files).

The above also reflects git-mv, as half of it is git-rm (although without some issues). Also git-mv could skip over non git-controlled files.

> Especially, why do we even encourage copy-and-paste?

But git-cp would be IMHO a convenience only. The half of pros for git-mv applies to this too; unfortunately the second part of pros for git-mv does not apply for git-cp.

Would git-cp encourage copy'n'paste programming? I'm not sure...
-- 
Jakub Narebski
Poland
Previous: Robin RosenbergNext: Matthieu Moy
Message 10 of 14 in “What about git cp ?”
  1. Francis MoreauFeb 3, 2008
  2. Matthieu MoyFeb 3, 2008
  3. Jakub NarebskiFeb 3, 2008
  4. Implement git-cp.Miklos Vajna, Feb 10, 2008
  5. Johannes SchindelinFeb 10, 2008
  6. Junio C HamanoFeb 10, 2008
  7. Johannes SchindelinFeb 10, 2008
  8. Miklos VajnaFeb 10, 2008
  9. Robin RosenbergFeb 10, 2008
  10. Jakub NarebskiFeb 11, 2008
  11. Matthieu MoyFeb 11, 2008
  12. Miklos VajnaFeb 11, 2008
  13. Implement git-cp.Miklos Vajna, Feb 10, 2008
  14. Remi VanicatFeb 3, 2008

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.