From: Stefan Moch Date: Sun, 31 Dec 2017 19:11:54 GMT Subject: Re: feature-request: git "cp" like there is git mv. Message-ID: <20171231191156.28359-1-stefanmoch@mail.de> In-Reply-To: <20171216013130.GB188893@aiede.mtv.corp.google.com> * Jonathan Nieder [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