t;.
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
---
t/t3200-branch.sh | 2 +-
1 file changed, 1 insertion(+), 1 del
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
checked out
branch and create a new branch with name "new-branch".
On Mon, May 29, 2017 at 4:09 AM, Junio C Hamano wrote:
>
> Sahil Dua writes:
>
> > New feature - copying a branch along with its config section.
>
> That's an unusual non-sentence (without a verb) in
On Mon, May 29, 2017 at 1:30 AM, Ævar Arnfjörð Bjarmason
wrote:
> On Mon, May 29, 2017 at 12:56 AM, Sahil Dua wrote:
>> 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
>> re
On Mon, May 29, 2017 at 10:50 PM, Ævar Arnfjörð Bjarmason
wrote:
> On Mon, May 29, 2017 at 10:41 PM, Sahil Dua wrote:
>> On Mon, May 29, 2017 at 1:30 AM, Ævar Arnfjörð Bjarmason
>> wrote:
>>> On Mon, May 29, 2017 at 12:56 AM, Sahil Dua wrote:
>>>> New featu
ur copied
section. Hence, literally 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.
Sign
nges a lot 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
---
builtin/branch.c | 48 +++
builti
enamed 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
---
builtin/branch.c | 4 ++--
builtin/config.c | 4 ++--
builtin/remote.c |
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
---
t/t3200-branch.sh | 53
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
---
builtin/branch.c | 2 +-
1 file changed, 1
o"] intact and 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
---
config.c | 14 --
1 file changed, 12 insertions(+), 2 deletion
On Thu, Jun 1, 2017 at 3:50 AM, Junio C Hamano wrote:
> Sahil Dua writes:
>
>> Adds copy branch option available using -c or -C (forcefully).
>>
>> Includes a lot of function renames and their signature changes in order
>> to introduce a new function parameter
push to the 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
---
t/t3200-branch.sh | 100 ++
o"] intact and 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
---
config.c | 14 --
1 file changed, 12 insertions(+), 2 deletion
and is used, operation
should delete 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 confi
On Thu, Jun 1, 2017 at 8:59 PM, Ævar Arnfjörð Bjarmason
wrote:
>
> On Thu, Jun 1, 2017 at 8:35 PM, Sahil Dua wrote:
> > Adds copy branch option available using -c or -C (forcefully).
>
> Commenting on the series in general. I have a fixup branch for you
> with commi
push to the 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
---
t/t3200-branch.sh | 100 ++
nfig
section.
fixups by avar:
- fixup: use git 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
---
builtin/branch.c |
o"] intact and 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
---
config.c | 14 --
1 file changed, 12 insertions(+), 2 deletion
be changed, can someone please point me to
how it's being handled so that I can change the behavior.
On Mon, Jun 5, 2017 at 10:40 PM, Sahil Dua wrote:
> Adds copy branch option available using -c or -C (forcefully).
>
> Adds new function copy_existing_ref to cop
However,
there's one similar test case for -M option.
Signed-off-by: Sahil Dua
---
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-br
On Tue, Jun 6, 2017 at 3:27 AM, Junio C Hamano wrote:
> Sahil Dua writes:
>
>> Adds a test for the case when only one parameter is passed to '-m'
>> (move/rename) option.
>>
>> For example - if 'git branch -m bbb' is run, it should rename the
&g
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 case that I
However,
there's one 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
---
t/t32
ote that since
the topmost entry 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
---
t/t3200-branch.sh | 17 +
1 file changed, 17 insertions(+)
diff
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 f
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
Signed-off-by: Ævar Arnfjörð Bjarmason
Signed-off-by: Sahil Dua
---
t/t3200-bran
o do about that is left to a
future change.
Helped-by: Ævar Arnfjörð Bjarmason
Signed-off-by: Sahil Dua
Signed-off-by: Ævar Arnfjörð Bjarmason
---
Documentation/git-branch.txt | 14 ++-
builtin/branch.c | 67 ++
cache.h | 2 +
config.c
On Tue, Jun 13, 2017 at 7:30 PM, Junio C Hamano wrote:
> Junio C Hamano writes:
>
>> 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
>&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
On Sat, Jun 17, 2017 at 11:40 PM, Sahil Dua 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 in public API.
I noticed that git_conf
fig file.
Signed-off-by: Ævar Arnfjörð Bjarmason
Signed-off-by: Ramsay Jones
Signed-off-by: Sahil Dua
---
config.c | 13 +++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/config.c b/config.c
index 34a139c..32fd3c8 100644
--- a/config.c
+++ b/config.c
@@ -2169,10 +2169,10 @
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
Signed-off-by: Ævar Arnfjörð Bjarmason
Signed-off-by: Sahil Dua
---
Changes
* Use 'sed -n -e'
ad of
master, as the user might expect. What to do about that is left to a
future change.
Helped-by: Ævar Arnfjörð Bjarmason
Signed-off-by: Ævar Arnfjörð Bjarmason
Signed-off-by: Sahil Dua
---
Documentation/git-branch.txt | 14 ++-
builtin/branch.c | 67 ++
cac
On Mon, Jun 19, 2017 at 2:08 PM, Ramsay Jones
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 "foo"]'.
>>
>
> * 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" learn
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)
>> + branch: add a --copy (-c) option to
>
> * 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
>
checked out'
> git checkout -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