Re: [PATCH/RFC v4 3/3] branch: add copy branch feature implementation

2017-06-06 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > On Tue, Jun 6, 2017 at 2:10 AM, Junio C Hamano wrote: > >> When somebody says "I want to rename my current branch to X", it is >> clear that the person wants to end up being on a branch called X. >> >> To me, "I want to copy

Re: [PATCH/RFC v4 3/3] branch: add copy branch feature implementation

2017-06-06 Thread Sahil Dua
On Tue, Jun 6, 2017 at 9:39 AM, Ævar Arnfjörð Bjarmason wrote: > On Tue, Jun 6, 2017 at 2:10 AM, Junio C Hamano wrote: >> Sahil Dua writes: >> >>> I want suggestions about one logical point raised by Evar. >>> >>> Let's consider a

Re: [PATCH/RFC v4 3/3] branch: add copy branch feature implementation

2017-06-06 Thread Ævar Arnfjörð Bjarmason
On Tue, Jun 6, 2017 at 2:10 AM, Junio C Hamano wrote: > Sahil Dua writes: > >> I want suggestions about one logical point raised by Evar. >> >> Let's consider a case that I'm on branch maint and then I do 'git >> checkout master' followed by 'git branch

Re: [PATCH/RFC v4 3/3] branch: add copy branch feature implementation

2017-06-05 Thread Junio C Hamano
Junio C Hamano writes: > When somebody says "I want to rename my current branch to X", it is > clear that the person wants to end up being on a branch called X. > > To me, "I want to copy my current branch to Y" sounds more like "I > want to create another Y that looks just

Re: [PATCH/RFC v4 3/3] branch: add copy branch feature implementation

2017-06-05 Thread Junio C Hamano
Sahil Dua writes: > I want suggestions about one logical point raised by Evar. > > Let's consider a case that I'm on branch maint and then I do 'git > checkout master' followed by 'git branch -m feature', it will rename > master branch to feature. Now if I do 'git

Re: [PATCH/RFC v4 3/3] branch: add copy branch feature implementation

2017-06-05 Thread Sahil Dua
I want suggestions about one logical point raised by Evar. Let's consider a case that I'm on branch maint and then I do 'git checkout master' followed by 'git branch -m feature', it will rename master branch to feature. Now if I do 'git checkout -' to go to the last branch, it will take me to

[PATCH/RFC v4 3/3] branch: add copy branch feature implementation

2017-06-05 Thread Sahil Dua
Adds copy branch option available using -c or -C (forcefully). Adds new function copy_existing_ref to copy the ref and git_config_copy_section to copy the git config section. Under the hood, both git_config_copy_section and git_config_rename_section functions use the same function which takes a