* Git pull --rebase with strategy ours doesn't work (possibly bug)
@ 2011-06-13 3:05 Dmitry S. Kravtsov
2011-06-13 3:21 ` Dmitry S. Kravtsov
2011-06-13 15:01 ` Junio C Hamano
0 siblings, 2 replies; 5+ messages in thread
From: Dmitry S. Kravtsov @ 2011-06-13 3:05 UTC (permalink / raw)
To: git
Hi,
So here the steps to reproduce:
$ git init A
Initialized empty Git repository in /home/catsadmin/git-test/A/.git/
$ (cd A && echo 123 > file && git add file && git commit -m "1st")
[master (root-commit) 1055edf] 1st
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 file
$ git clone A B
Cloning into B...
done.
$ git clone A C
Cloning into C...
done.
$ (cd B && echo 333 >file && git commit -am "2nd")
[master 4e9cd67] 2nd
1 files changed, 1 insertions(+), 1 deletions(-)
$ (cd A && git pull ~/git-test/B master)
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/catsadmin/git-test/B
* branch master -> FETCH_HEAD
Updating 1055edf..4e9cd67
Fast-forward
file | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
$ (cd C && echo 111 > file && git commit -am "3rd")
[master 1c4a368] 3rd
1 files changed, 1 insertions(+), 1 deletions(-)
$ cd C
$ git push origin master
To /home/catsadmin/git-test/A
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '/home/catsadmin/git-test/A'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
So my idea is to create a straight line history, that will look like
"1st"---"2nd"---"3rd",
and from git-rebase man page I read, that strategy ours allows us to
discard conflicing changes in favor
of ours.
$ git pull --rebase -s ours origin master
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/catsadmin/git-test/A
* branch master -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Already applied: 0001 3rd
/usr/bin/git-rebase: line 157:
/home/catsadmin/git-test/C/.git/rebase-merge/rewritten: Нет такого
файла или каталога
All done.
This message not only looks weird, it also discard my "3rd" commit
from master tree:
$ git branch
* master
$ git log
commit 4e9cd6730b1215b22b65fbcc6cbf87e331e5eb92
Author: Your Name <you@example.com>
Date: Mon Jun 13 13:53:27 2011 +1100
2nd
commit 1055edf3618787ea53231ed6f4b00dfe571c8940
Author: Your Name <you@example.com>
Date: Mon Jun 13 13:52:53 2011 +1100
1st
Am I wrong at something?
--
Dmitry S. Kravtsov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Git pull --rebase with strategy ours doesn't work (possibly bug)
2011-06-13 3:05 Git pull --rebase with strategy ours doesn't work (possibly bug) Dmitry S. Kravtsov
@ 2011-06-13 3:21 ` Dmitry S. Kravtsov
2011-06-13 3:41 ` Dmitry S. Kravtsov
2011-06-13 15:01 ` Junio C Hamano
1 sibling, 1 reply; 5+ messages in thread
From: Dmitry S. Kravtsov @ 2011-06-13 3:21 UTC (permalink / raw)
To: git
Excuse me for russian locale, the part with error in english locale:
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/kravitz/git-test/A
* branch master -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Already applied: 0001 3rd
/usr/libexec/git-core/git-rebase: line 157:
/home/kravitz/git-test/C/.git/rebase-merge/rewritten: No such file or
directory
All done.
kravitz@Vor
2011/6/13 Dmitry S. Kravtsov <idkravitz@gmail.com>:
> Hi,
>
> So here the steps to reproduce:
>
> $ git init A
> Initialized empty Git repository in /home/catsadmin/git-test/A/.git/
> $ (cd A && echo 123 > file && git add file && git commit -m "1st")
> [master (root-commit) 1055edf] 1st
> 1 files changed, 1 insertions(+), 0 deletions(-)
> create mode 100644 file
> $ git clone A B
> Cloning into B...
> done.
> $ git clone A C
> Cloning into C...
> done.
> $ (cd B && echo 333 >file && git commit -am "2nd")
> [master 4e9cd67] 2nd
> 1 files changed, 1 insertions(+), 1 deletions(-)
> $ (cd A && git pull ~/git-test/B master)
> remote: Counting objects: 5, done.
> remote: Total 3 (delta 0), reused 0 (delta 0)
> Unpacking objects: 100% (3/3), done.
> From /home/catsadmin/git-test/B
> * branch master -> FETCH_HEAD
> Updating 1055edf..4e9cd67
> Fast-forward
> file | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> $ (cd C && echo 111 > file && git commit -am "3rd")
> [master 1c4a368] 3rd
> 1 files changed, 1 insertions(+), 1 deletions(-)
> $ cd C
> $ git push origin master
> To /home/catsadmin/git-test/A
> ! [rejected] master -> master (non-fast-forward)
> error: failed to push some refs to '/home/catsadmin/git-test/A'
> To prevent you from losing history, non-fast-forward updates were rejected
> Merge the remote changes (e.g. 'git pull') before pushing again. See the
> 'Note about fast-forwards' section of 'git push --help' for details.
>
> So my idea is to create a straight line history, that will look like
> "1st"---"2nd"---"3rd",
> and from git-rebase man page I read, that strategy ours allows us to
> discard conflicing changes in favor
> of ours.
>
> $ git pull --rebase -s ours origin master
> remote: Counting objects: 5, done.
> remote: Total 3 (delta 0), reused 0 (delta 0)
> Unpacking objects: 100% (3/3), done.
> From /home/catsadmin/git-test/A
> * branch master -> FETCH_HEAD
> First, rewinding head to replay your work on top of it...
> Already applied: 0001 3rd
> /usr/bin/git-rebase: line 157:
> /home/catsadmin/git-test/C/.git/rebase-merge/rewritten: Нет такого
> файла или каталога
> All done.
>
> This message not only looks weird, it also discard my "3rd" commit
> from master tree:
> $ git branch
> * master
> $ git log
> commit 4e9cd6730b1215b22b65fbcc6cbf87e331e5eb92
> Author: Your Name <you@example.com>
> Date: Mon Jun 13 13:53:27 2011 +1100
>
> 2nd
>
> commit 1055edf3618787ea53231ed6f4b00dfe571c8940
> Author: Your Name <you@example.com>
> Date: Mon Jun 13 13:52:53 2011 +1100
>
> 1st
>
> Am I wrong at something?
>
> --
> Dmitry S. Kravtsov
>
--
Dmitry S. Kravtsov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Git pull --rebase with strategy ours doesn't work (possibly bug)
2011-06-13 3:21 ` Dmitry S. Kravtsov
@ 2011-06-13 3:41 ` Dmitry S. Kravtsov
2011-06-13 3:50 ` Dmitry S. Kravtsov
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry S. Kravtsov @ 2011-06-13 3:41 UTC (permalink / raw)
To: git
Also I read that during rebase terms ours and theirs are swapped, but
it i change strategy to theirs it's still error, but even more
cryptic:
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/kravitz/git-test/A
* branch master -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
/usr/libexec/git-core/git-rebase: line 117: git-merge-theirs: command not found
Unknown exit code (127) from command: git-merge-theirs
1a3b9bcbc737728ae997368d6d850a6a265681b7^ -- HEAD
1a3b9bcbc737728ae997368d6d850a6a265681b7
2011/6/13 Dmitry S. Kravtsov <idkravitz@gmail.com>:
> Excuse me for russian locale, the part with error in english locale:
>
> remote: Counting objects: 5, done.
> remote: Total 3 (delta 0), reused 0 (delta 0)
> Unpacking objects: 100% (3/3), done.
> From /home/kravitz/git-test/A
> * branch master -> FETCH_HEAD
> First, rewinding head to replay your work on top of it...
> Already applied: 0001 3rd
> /usr/libexec/git-core/git-rebase: line 157:
> /home/kravitz/git-test/C/.git/rebase-merge/rewritten: No such file or
> directory
> All done.
> kravitz@Vor
>
>
> 2011/6/13 Dmitry S. Kravtsov <idkravitz@gmail.com>:
>> Hi,
>>
>> So here the steps to reproduce:
>>
>> $ git init A
>> Initialized empty Git repository in /home/catsadmin/git-test/A/.git/
>> $ (cd A && echo 123 > file && git add file && git commit -m "1st")
>> [master (root-commit) 1055edf] 1st
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>> create mode 100644 file
>> $ git clone A B
>> Cloning into B...
>> done.
>> $ git clone A C
>> Cloning into C...
>> done.
>> $ (cd B && echo 333 >file && git commit -am "2nd")
>> [master 4e9cd67] 2nd
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>> $ (cd A && git pull ~/git-test/B master)
>> remote: Counting objects: 5, done.
>> remote: Total 3 (delta 0), reused 0 (delta 0)
>> Unpacking objects: 100% (3/3), done.
>> From /home/catsadmin/git-test/B
>> * branch master -> FETCH_HEAD
>> Updating 1055edf..4e9cd67
>> Fast-forward
>> file | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>> $ (cd C && echo 111 > file && git commit -am "3rd")
>> [master 1c4a368] 3rd
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>> $ cd C
>> $ git push origin master
>> To /home/catsadmin/git-test/A
>> ! [rejected] master -> master (non-fast-forward)
>> error: failed to push some refs to '/home/catsadmin/git-test/A'
>> To prevent you from losing history, non-fast-forward updates were rejected
>> Merge the remote changes (e.g. 'git pull') before pushing again. See the
>> 'Note about fast-forwards' section of 'git push --help' for details.
>>
>> So my idea is to create a straight line history, that will look like
>> "1st"---"2nd"---"3rd",
>> and from git-rebase man page I read, that strategy ours allows us to
>> discard conflicing changes in favor
>> of ours.
>>
>> $ git pull --rebase -s ours origin master
>> remote: Counting objects: 5, done.
>> remote: Total 3 (delta 0), reused 0 (delta 0)
>> Unpacking objects: 100% (3/3), done.
>> From /home/catsadmin/git-test/A
>> * branch master -> FETCH_HEAD
>> First, rewinding head to replay your work on top of it...
>> Already applied: 0001 3rd
>> /usr/bin/git-rebase: line 157:
>> /home/catsadmin/git-test/C/.git/rebase-merge/rewritten: Нет такого
>> файла или каталога
>> All done.
>>
>> This message not only looks weird, it also discard my "3rd" commit
>> from master tree:
>> $ git branch
>> * master
>> $ git log
>> commit 4e9cd6730b1215b22b65fbcc6cbf87e331e5eb92
>> Author: Your Name <you@example.com>
>> Date: Mon Jun 13 13:53:27 2011 +1100
>>
>> 2nd
>>
>> commit 1055edf3618787ea53231ed6f4b00dfe571c8940
>> Author: Your Name <you@example.com>
>> Date: Mon Jun 13 13:52:53 2011 +1100
>>
>> 1st
>>
>> Am I wrong at something?
>>
>> --
>> Dmitry S. Kravtsov
>>
>
>
>
> --
> Dmitry S. Kravtsov
>
--
Dmitry S. Kravtsov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Git pull --rebase with strategy ours doesn't work (possibly bug)
2011-06-13 3:41 ` Dmitry S. Kravtsov
@ 2011-06-13 3:50 ` Dmitry S. Kravtsov
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry S. Kravtsov @ 2011-06-13 3:50 UTC (permalink / raw)
To: git
So, while I still don't understand, why we got this errors I also
found that my task is accomplished by using recursive strategy and
theirs option.
2011/6/13 Dmitry S. Kravtsov <idkravitz@gmail.com>:
> Also I read that during rebase terms ours and theirs are swapped, but
> it i change strategy to theirs it's still error, but even more
> cryptic:
>
> remote: Counting objects: 5, done.
> remote: Total 3 (delta 0), reused 0 (delta 0)
> Unpacking objects: 100% (3/3), done.
> From /home/kravitz/git-test/A
> * branch master -> FETCH_HEAD
> First, rewinding head to replay your work on top of it...
> /usr/libexec/git-core/git-rebase: line 117: git-merge-theirs: command not found
> Unknown exit code (127) from command: git-merge-theirs
> 1a3b9bcbc737728ae997368d6d850a6a265681b7^ -- HEAD
> 1a3b9bcbc737728ae997368d6d850a6a265681b7
>
> 2011/6/13 Dmitry S. Kravtsov <idkravitz@gmail.com>:
>> Excuse me for russian locale, the part with error in english locale:
>>
>> remote: Counting objects: 5, done.
>> remote: Total 3 (delta 0), reused 0 (delta 0)
>> Unpacking objects: 100% (3/3), done.
>> From /home/kravitz/git-test/A
>> * branch master -> FETCH_HEAD
>> First, rewinding head to replay your work on top of it...
>> Already applied: 0001 3rd
>> /usr/libexec/git-core/git-rebase: line 157:
>> /home/kravitz/git-test/C/.git/rebase-merge/rewritten: No such file or
>> directory
>> All done.
>> kravitz@Vor
>>
>>
>> 2011/6/13 Dmitry S. Kravtsov <idkravitz@gmail.com>:
>>> Hi,
>>>
>>> So here the steps to reproduce:
>>>
>>> $ git init A
>>> Initialized empty Git repository in /home/catsadmin/git-test/A/.git/
>>> $ (cd A && echo 123 > file && git add file && git commit -m "1st")
>>> [master (root-commit) 1055edf] 1st
>>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>> create mode 100644 file
>>> $ git clone A B
>>> Cloning into B...
>>> done.
>>> $ git clone A C
>>> Cloning into C...
>>> done.
>>> $ (cd B && echo 333 >file && git commit -am "2nd")
>>> [master 4e9cd67] 2nd
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>> $ (cd A && git pull ~/git-test/B master)
>>> remote: Counting objects: 5, done.
>>> remote: Total 3 (delta 0), reused 0 (delta 0)
>>> Unpacking objects: 100% (3/3), done.
>>> From /home/catsadmin/git-test/B
>>> * branch master -> FETCH_HEAD
>>> Updating 1055edf..4e9cd67
>>> Fast-forward
>>> file | 2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>> $ (cd C && echo 111 > file && git commit -am "3rd")
>>> [master 1c4a368] 3rd
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>> $ cd C
>>> $ git push origin master
>>> To /home/catsadmin/git-test/A
>>> ! [rejected] master -> master (non-fast-forward)
>>> error: failed to push some refs to '/home/catsadmin/git-test/A'
>>> To prevent you from losing history, non-fast-forward updates were rejected
>>> Merge the remote changes (e.g. 'git pull') before pushing again. See the
>>> 'Note about fast-forwards' section of 'git push --help' for details.
>>>
>>> So my idea is to create a straight line history, that will look like
>>> "1st"---"2nd"---"3rd",
>>> and from git-rebase man page I read, that strategy ours allows us to
>>> discard conflicing changes in favor
>>> of ours.
>>>
>>> $ git pull --rebase -s ours origin master
>>> remote: Counting objects: 5, done.
>>> remote: Total 3 (delta 0), reused 0 (delta 0)
>>> Unpacking objects: 100% (3/3), done.
>>> From /home/catsadmin/git-test/A
>>> * branch master -> FETCH_HEAD
>>> First, rewinding head to replay your work on top of it...
>>> Already applied: 0001 3rd
>>> /usr/bin/git-rebase: line 157:
>>> /home/catsadmin/git-test/C/.git/rebase-merge/rewritten: Нет такого
>>> файла или каталога
>>> All done.
>>>
>>> This message not only looks weird, it also discard my "3rd" commit
>>> from master tree:
>>> $ git branch
>>> * master
>>> $ git log
>>> commit 4e9cd6730b1215b22b65fbcc6cbf87e331e5eb92
>>> Author: Your Name <you@example.com>
>>> Date: Mon Jun 13 13:53:27 2011 +1100
>>>
>>> 2nd
>>>
>>> commit 1055edf3618787ea53231ed6f4b00dfe571c8940
>>> Author: Your Name <you@example.com>
>>> Date: Mon Jun 13 13:52:53 2011 +1100
>>>
>>> 1st
>>>
>>> Am I wrong at something?
>>>
>>> --
>>> Dmitry S. Kravtsov
>>>
>>
>>
>>
>> --
>> Dmitry S. Kravtsov
>>
>
>
>
> --
> Dmitry S. Kravtsov
>
--
Dmitry S. Kravtsov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Git pull --rebase with strategy ours doesn't work (possibly bug)
2011-06-13 3:05 Git pull --rebase with strategy ours doesn't work (possibly bug) Dmitry S. Kravtsov
2011-06-13 3:21 ` Dmitry S. Kravtsov
@ 2011-06-13 15:01 ` Junio C Hamano
1 sibling, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2011-06-13 15:01 UTC (permalink / raw)
To: Dmitry S. Kravtsov; +Cc: git
"Dmitry S. Kravtsov" <idkravitz@gmail.com> writes:
> and from git-rebase man page I read, that strategy ours allows us to
> discard conflicing changes in favor
> of ours.
That is not what the "ours" strategy is about. When merging another
history into our history, the strategy marks the other history "merged"
while using our tree as the result of the merge, without using _anything_
from their history.
It is not a way to take whatever that happen to merge cleanly textually
but use our change in only the conflicting parts. You are probably
confusing it with 'ours' option of the recursive strategy, that is used in
"git merge -Xours".
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-06-13 15:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-13 3:05 Git pull --rebase with strategy ours doesn't work (possibly bug) Dmitry S. Kravtsov
2011-06-13 3:21 ` Dmitry S. Kravtsov
2011-06-13 3:41 ` Dmitry S. Kravtsov
2011-06-13 3:50 ` Dmitry S. Kravtsov
2011-06-13 15:01 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).