[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: feature-request: git "cp" like there is git mv.
From:       Stefan Moch <stefanmoch () mail ! de>
Date:       2017-12-31 19:11:54
Message-ID: 20171231191156.28359-1-stefanmoch () mail ! de
[Download RAW message or body]

* Jonathan Nieder <jrnieder@gmail.com> [2017-12-15T17:31:30-0800]:
> This sounds like a reasonable thing to add.  See builtin/mv.c for how
> "git mv" works if you're looking for inspiration.
> 
> cmd_mv in that file looks rather long, so I'd also be happy if someone
> interested refactors to break it into multiple self-contained pieces
> for easier reading (git mostly follows
> https://www.kernel.org/doc/html/latest/process/coding-style.html#functions).

I looked at builtin/mv.c and have a rough idea how to split it
up to support both mv and cp commands.

But first I noticed and removed a redundant check in cmd_mv,
also added a test case to check if mv --dry-run does not move
the file.


Stefan
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic