>
> * sd/branch-copy (2017-06-18) 3 commits
> (merged to 'next' on 2017-07-18 at 5e3b9357ea)
> + branch: add a --copy (-c) option to go with --move (-m)
> + branch: add test for -m renaming multiple config sections
> + config: create a function to format section headers
>
> "git branch"
Ah! I had skipped this reply from Ramsay earlier.
On Tue, Aug 1, 2017 at 1:36 AM, Ramsay Jones
wrote:
>
>
> On 31/07/17 23:30, Junio C Hamano wrote:
> [snip]
>>
>> * sd/branch-copy (2017-06-18) 3 commits
>> (merged to 'next' on 2017-07-18 at 5e3b9357ea)
>> +
On Mon, Jun 19, 2017 at 2:08 PM, Ramsay Jones
<ram...@ramsayjones.plus.com> wrote:
>
>
> On 18/06/17 22:16, Sahil Dua wrote:
>> Factor out the logic which creates section headers in the config file,
>> e.g. the 'branch.foo' key will be turned into '[branch &qu
Earlier it was trying to access invalid config key and hence was getting
an error. However, this wasn't caught because we were expecting the
command to fail for other reason as mentioned above.
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
t/t3200-branch.sh | 2 +-
1 file chan
ch and create a new branch with name "new-branch".
On Mon, May 29, 2017 at 4:09 AM, Junio C Hamano <gits...@pobox.com> wrote:
>
> Sahil Dua <sahildua2...@gmail.com> writes:
>
> > New feature - copying a branch along with its config section.
>
> That's
On Mon, May 29, 2017 at 1:30 AM, Ævar Arnfjörð Bjarmason
<ava...@gmail.com> wrote:
> On Mon, May 29, 2017 at 12:56 AM, Sahil Dua <sahildua2...@gmail.com> wrote:
>> New feature - copying a branch along with its config section.
>>
>> Aim is to have an option -c
New feature - copying a branch along with its config section.
Aim is to have an option -c for copying a branch just like -m option for
renaming a branch.
This commit adds a few basic tests for getting any suggestions/feedback
about expected behavior for this new feature.
Signed-off-by: Sahil
On Mon, May 29, 2017 at 10:50 PM, Ævar Arnfjörð Bjarmason
<ava...@gmail.com> wrote:
> On Mon, May 29, 2017 at 10:41 PM, Sahil Dua <sahildua2...@gmail.com> wrote:
>> On Mon, May 29, 2017 at 1:30 AM, Ævar Arnfjörð Bjarmason
>> <ava...@gmail.com> wrote:
>>> O
of other files wherever the renamed
functions were used. By default copy=0 is passed at all those places so
that they keep behaving the way they were, before these changes.
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
builtin/branch.c
he renamed and updated functions were being used. Default value of
copy=0 is passed at all those places in order to make sure the behavior
of the functions doesn't change for those cases.
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
builtin/branch.c | 4 ++--
builtin/config.c | 4 ++--
Adds a few basic tests for getting any suggestions/feedback
about expected behavior for this new feature. Aim is to have an option -c
for copying a branch just like -m option for renaming a branch.
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
t/t3200-branch.s
It doesn't make sense to trigger config section copy or rename method if
both the branch names are same.
For example - git branch -C a a
In such a case, it shouldn't try to copy or rename the git config
section.
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
builtin/branch.c | 2
get [branch "bar"]
from "branch.bar" key. 'store_create_section' function will return
[branch "bar"] when "branch.bar" is passed.
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
config.c | 14 --
1 file changed, 12 insertions(+), 2 deletions(-)
dif
copying the config section from branch1 to
branch2.
However, there's one case which is not handled by this yet - when
branch2 already has some configuration and -C command is used, operation
should delete the present configuration for branch2.
Signed-off-by: Sahil Dua <sahildua2...@gmail.
On Thu, Jun 1, 2017 at 3:50 AM, Junio C Hamano <gits...@pobox.com> wrote:
> Sahil Dua <sahildua2...@gmail.com> writes:
>
>> Adds copy branch option available using -c or -C (forcefully).
>>
>> Includes a lot of function renames and their signature changes in
he same branch as "git
push on topic-1 branch would.
4. "git branch -c new-branch" should copy the currently checked out
branch and create a new branch with name "new-branch".
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
t/t3200-branch.sh | 100 ++
get [branch "bar"]
from "branch.bar" key. 'store_create_section' function will return
[branch "bar"] when "branch.bar" is passed.
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
config.c | 14 --
1 file changed, 12 insertions(+), 2 deletions(-)
dif
the present configuration for branch2.
Also, it doesn't make sense to trigger config section copy config
section function if both the branch names are same.
For example - git branch -C a a
In such a case, it shouldn't try to copy or rename the git config
section.
Signed-off-by: Sahil Dua <sahild
On Thu, Jun 1, 2017 at 8:59 PM, Ævar Arnfjörð Bjarmason
<ava...@gmail.com> wrote:
>
> On Thu, Jun 1, 2017 at 8:35 PM, Sahil Dua <sahildua2...@gmail.com> wrote:
> > Adds copy branch option available using -c or -C (forcefully).
>
> Commenting on the series in general.
On Tue, Jun 6, 2017 at 9:39 AM, Ævar Arnfjörð Bjarmason
<ava...@gmail.com> wrote:
> On Tue, Jun 6, 2017 at 2:10 AM, Junio C Hamano <gits...@pobox.com> wrote:
>> Sahil Dua <sahildua2...@gmail.com> writes:
>>
>>> I want suggestions about one logical po
On Tue, Jun 6, 2017 at 3:27 AM, Junio C Hamano <gits...@pobox.com> wrote:
> Sahil Dua <sahildua2...@gmail.com> writes:
>
>> Adds a test for the case when only one parameter is passed to '-m'
>> (move/rename) option.
>>
>> For example - if 'g
on reflog for bbb will be about branch creation, we
compare bbb@{1} (instead of bbb@{0}) with aaa@{0} to make sure the
reflog for bbb retains entries from aaa.
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
t/t3200-branch.sh | 17 +
1 file changed, 17 insertions(+)
diff --g
Hi Ramsay,
Thanks for noticing. I will squash this into the relevant patch.
Also, git_config_copy_section_in_file() and refs_copy_existing_ref()
don't need to be available in public API.
Regards
Sahil Dua
Graduate Software Developer
Booking.com
Connect on LinkedIn
www.sahildua.com
On Thu, Jun
On Sat, Jun 17, 2017 at 11:40 PM, Sahil Dua <sahildua2...@gmail.com> wrote:
> Hi Ramsay,
>
> Thanks for noticing. I will squash this into the relevant patch.
>
> Also, git_config_copy_section_in_file() and refs_copy_existing_ref()
> don't need to be available
On Tue, Jun 13, 2017 at 7:30 PM, Junio C Hamano <gits...@pobox.com> wrote:
> Junio C Hamano <gits...@pobox.com> writes:
>
>> Sahil Dua <sahildua2...@gmail.com> writes:
>>
>>> Add the ability to --copy a branch and its reflog and configuration
f-by: Ævar Arnfjörð Bjarmason <ava...@gmail.com>
Signed-off-by: Ramsay Jones <ram...@ramsayjones.plus.com>
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
config.c | 13 +++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/config.c b/config.c
i
g when editing
the file with git-config.
This adds a test for the currently expected semantics in the face of
some rather obscure edge cases which are unlikely to occur in
practice.
Helped-by: Sahil Dua <sahildua2...@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <ava...@gmail.com>
Signed
ect. What to do about that is left to a
future change.
Helped-by: Ævar Arnfjörð Bjarmason <ava...@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <ava...@gmail.com>
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
Documentation/git-branch.txt | 14 ++-
builti
similar test case for -M option.
Add test for making sure HEAD points to the bbb (new branch name). Also
add a test for making sure the reflog that is moved to 'bbb' retains
entries created for the currently checked out branch.
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
t/t3200-bra
change.
Helped-by: Ævar Arnfjörð Bjarmason <ava...@gmail.com>
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <ava...@gmail.com>
---
Documentation/git-branch.txt | 14 ++-
builtin/branch.c | 67 ++
cache.h
Factor out the logic which creates section headers in the config file,
e.g. the 'branch.foo' key will be turned into '[branch "foo"]'.
This introduces no function changes, but is needed for a later change
which adds support for copying branch sections in the config file.
Signed-off-by:
g when editing
the file with git-config.
This adds a test for the currently expected semantics in the face of
some rather obscure edge cases which are unlikely to occur in
practice.
Helped-by: Sahil Dua <sahildua2...@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <ava...@gmail.com>
Signed
change the behavior.
On Mon, Jun 5, 2017 at 10:40 PM, Sahil Dua <sahildua2...@gmail.com> wrote:
> 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 secti
comment style, and not C++ comments...
- fixup bad i18n usage
This interpolation of English words with sprintf resulted in
untranslatable strings.
- fixup mixed code/decl warning
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
builtin/branch.c
he same branch as "git
push on topic-1 branch would.
4. "git branch -c new-branch" should copy the currently checked out
branch and create a new branch with name "new-branch".
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
t/t3200-branch.sh | 100 ++
get [branch "bar"]
from "branch.bar" key. 'store_create_section' function will return
[branch "bar"] when "branch.bar" is passed.
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
config.c | 14 --
1 file changed, 12 insertions(+), 2 deletions(-)
dif
similar test case for -M option.
Signed-off-by: Sahil Dua <sahildua2...@gmail.com>
---
t/t3200-branch.sh | 8
1 file changed, 8 insertions(+)
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index fe62e7c775da6..7504f14bc52f8 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-bra
>
> * sd/branch-copy (2017-06-18) 3 commits
> - branch: add a --copy (-c) option to go with --move (-m)
> - branch: add test for -m renaming multiple config sections
> - config: create a function to format section headers
>
> "git branch" learned "-c/-C" to create and switch to a new branch
>
eckout -b c1 &&
> git branch c2 &&
> git branch -C c1 c2 &&
> - test $(git rev-parse --abbrev-ref HEAD) = c2
> + test $(git rev-parse --abbrev-ref HEAD) = c1
> '
>
> -test_expect_success 'git branch -C c1 c2 should add entries to
> .git/logs/HEAD' '
> +test_expect_success 'git branch -C c1 c2 should never touch HEAD' '
> msg="Branch: copied refs/heads/c1 to refs/heads/c2" &&
> - grep "$msg$" .git/logs/HEAD
> + ! grep "$msg$" .git/logs/HEAD
> '
>
> test_expect_success 'git branch -C master should work when master is checked
> out' '
> --
> 2.14.1-907-g5aa63875cf
>
>
>
--
Regards
Sahil Dua
Software Developer
Booking.com
Connect on LinkedIn
www.sahildua.com
39 matches
Mail list logo