From: Junio C Hamano Date: Tue, 13 Jun 2017 17:05:56 GMT Subject: Re: [PATCH 3/3] branch: add a --copy (-c) option to go with --move (-m) Message-ID: In-Reply-To: <0102015ca23f054b-b7c281d9-c9e0-4691-bfa9-8c46fb77dfc7-000000@eu-west-1.amazonses.com> Sahil Dua writes: > Add the ability to --copy a branch and its reflog and configuration, > this uses the same underlying machinery as the --move (-m) option > except the reflog and configuration is copied instead of being moved. > > This is useful for e.g. copying a topic branch to a new version, > e.g. work to work-2 after submitting the work topic to the list, while > preserving all the tracking info and other configuration that goes > with the branch, and unlike --move keeping the other already-submitted > branch around for reference. > > Like --move, when the source branch is the currently checked out > branch the HEAD is moved to the destination branch. In the case of > --move we don't really have a choice (other than remaining on a > detached HEAD), but it makes sense to do the same for --copy. I strongly disagree with this "it makes sense to do the same". It would equally (if not more) make sense to keep the HEAD pointing at the same. Personally, I may use this feature if it didn't move HEAD, but I wouldn't if HEAD gets moved. But that may be just me.