git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Work is not replayed on top while: git pull -v --rebase
@ 2018-09-20 11:05 KES
  2018-09-20 14:38 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: KES @ 2018-09-20 11:05 UTC (permalink / raw)
  To: git

Hi.

TL;DR; Some local commits are lost while `git pull -v --rebase`

[alias]
    tree        = log --graph --decorate --pretty=oneline --abbrev-commit
    changes     = log --graph --decorate --pretty=oneline --abbrev-commit --cherry-pick --boundary --left-right

<HERE I do some work, commit it and push>

<after some time>

$ git fetch origin 
remote: Counting objects: 806, done.
remote: Compressing objects: 100% (197/197), done.
remote: Total 806 (delta 587), reused 806 (delta 587)
Receiving objects: 100% (806/806), 85.96 KiB | 0 bytes/s, done.
Resolving deltas: 100% (587/587), completed with 19 local objects.
From https://tracker.feel-safe.net/gitdev/main
 + a562406d...f9015227 296_tos    -> origin/296_tos  (forced update)

Here we see that someone did 'forced update'

$ git tree -n 5
* a562406d (HEAD -> 296_tos, back) Bulk changes         ### <<< PUT ATTENTION HERE
* 177e2515 Bulk changes
* 934bbb31 Fix Profile Page
* 811d8812 Fix button's width on Authorization form
* 97ca9419 Fix Tariff Options page

Here git know that a562406d already pushed to remote

Now I want to update my branch

$ git pull -v --rebase
From https://tracker.feel-safe.net/gitdev/main
 = [up to date]        296_tos                    -> origin/296_tos
....
 = [up to date]        text-page-style            -> origin/text-page-style
Changes from f66c29158a57d687aaf48fb89f9b897563c0142e to f9015227da20ad1f858174b4b4c188338eb26640:
 cpanfile                                |   4 +
....
 templates/v2/tos/tos.html.ep            |   4 +-
 31 files changed, 1694 insertions(+), 106 deletions(-)
 create mode 100644 lib/DbMapper.pm
....
 create mode 100644 t/DbMapper/update_data.t
First, rewinding head to replay your work on top of it...

$ git tree -n 5
* f9015227 (HEAD -> 296_tos, origin/296_tos) Bulk changes
* 95064421 Fix Profile Page
* c03c930a Fix button's width on Authorization form
* e6df0662 Fix Tariff Options page
* 22b5c754 Fix header on order page

$ diff <(git show f901522) <(git show 177e2515)
1c1
< commit f9015227da20ad1f858174b4b4c188338eb26640
---
> commit 177e2515eb2bc1c9733b4374f2da373aa969a601

$ git changes a562406d...f9015227
>   50e9343a Merge branch 'orm' into dash_v2
|\  
| > 4be5e3c6 Test data fetching from DataSet
| > 11d60181 More tests: Manual condition OP for join expression
....
| < a562406d (back) Bulk changes
o f66c2915 (origin/dash_v2, dash_v2) Merge branch 'move_example_elements' into dash_v2

We can see that a562406d after rebasing **is lost**


Why a562406d is not applied on top of remote branch?

PS. for `git push --force` there is alternative: --force-with-lease
Is there something similar to --force-with-lease but for `git pull -v --rebase`?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Work is not replayed on top while: git pull -v --rebase
  2018-09-20 11:05 Work is not replayed on top while: git pull -v --rebase KES
@ 2018-09-20 14:38 ` Junio C Hamano
  2018-09-25  6:42   ` KES
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2018-09-20 14:38 UTC (permalink / raw)
  To: KES; +Cc: git

KES <kes-kes@yandex.ru> writes:

> PS. for `git push --force` there is alternative: --force-with-lease
> Is there something similar to --force-with-lease but for `git pull -v --rebase`?

Curious.

For "push", you are competing with the other pushers who want to
update the repository over there, and there is need for the
force-with-lease=<it must be this verison> safety, but what is the
reason why you need to take a lease on your local side while doing
a "pull"?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Work is not replayed on top while: git pull -v --rebase
  2018-09-20 14:38 ` Junio C Hamano
@ 2018-09-25  6:42   ` KES
  2018-09-25  7:29     ` KES
  0 siblings, 1 reply; 4+ messages in thread
From: KES @ 2018-09-25  6:42 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

As you can see I have lost some commits. Thus I wanna an option to be safe

20.09.2018, 17:38, "Junio C Hamano" <gitster@pobox.com>:
> KES <kes-kes@yandex.ru> writes:
>
>>  PS. for `git push --force` there is alternative: --force-with-lease
>>  Is there something similar to --force-with-lease but for `git pull -v --rebase`?
>
> Curious.
>
> For "push", you are competing with the other pushers who want to
> update the repository over there, and there is need for the
> force-with-lease=<it must be this verison> safety, but what is the
> reason why you need to take a lease on your local side while doing
> a "pull"?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Work is not replayed on top while: git pull -v --rebase
  2018-09-25  6:42   ` KES
@ 2018-09-25  7:29     ` KES
  0 siblings, 0 replies; 4+ messages in thread
From: KES @ 2018-09-25  7:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

The commits are lost always if both users did `git push --force`

How to reproduce:
1. First user: `git push --force`
2. Second user: `git push --force`
3. First user: `git pull -v --rebase`

Here after 3 I expect that git will say that after rebase some commits from current branch will not be exists after rebasing

some logs:

kes@work ~/s $ git tree
* 704f068f (HEAD -> 296_tos, back) Fix message
*   8d9aef32 Merge branch 'fix_login_form' into 296_tos
|\  
| * f1c6616a Copy value over all contact
|/  
*   528b8f0d Merge branch 'fix_profile' into 296_tos

$ git pull -v --rebase
From https://tracker.feel-safe.net/gitdev/main
 = [up to date]        296_tos                    -> origin/296_tos
 = [up to date]        297-unification-of-buttons -> origin/297-unification-of-buttons
 = [up to date]        ToS-component              -> origin/ToS-component
 = [up to date]        authorization_pg           -> origin/authorization_pg
 = [up to date]        buy_dev                    -> origin/buy_dev
 = [up to date]        content_negotiation_fixes  -> origin/content_negotiation_fixes
 = [up to date]        dash_v2                    -> origin/dash_v2
 = [up to date]        design_master              -> origin/design_master
 = [up to date]        design_master_2            -> origin/design_master_2
 = [up to date]        fix_order_pg               -> origin/fix_order_pg
 = [up to date]        master                     -> origin/master
 = [up to date]        new_design_master          -> origin/new_design_master
 = [up to date]        new_error_pg               -> origin/new_error_pg
 = [up to date]        text-page-style            -> origin/text-page-style
Changes from f66c29158a57d687aaf48fb89f9b897563c0142e to e8875a0aa09cd1f352a41a5c164b5b2fdcdbe75b:
 public/profile/profile.html             |   2 +-
 public/v2/css/ask_options.css           |  17 ++++--
 public/v2/css/authorization.css         |  20 +++++--
 public/v2/css/input.css                 |   8 +--
 public/v2/css/layout.css                |  18 ++++---
 public/v2/css/media.css                 | 150 +++++++++++++++++++++++++++++++++++++++-------------
 public/v2/css/menu.css                  |   4 +-
 public/v2/css/profile.css               |   5 ++
 public/v2/css/tos.css                   |  38 ++++---------
 templates/v2/profile.html.ep            |  44 ++++++---------
 templates/v2/tariff/ask_options.html.ep |   2 +-
 templates/v2/tos/tos.html.ep            |   4 +-
 12 files changed, 195 insertions(+), 117 deletions(-)
Note: checking out 'e8875a0aa09cd1f352a41a5c164b5b2fdcdbe75b'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at e8875a0a Fix media queries for Profile Page
Rebasing (1/1)
704f068fc32b05e043d3ae7a2c06a853bcbaca85
[detached HEAD f85f0623] Fix message
 Date: Tue Sep 25 09:37:34 2018 +0300
 1 file changed, 1 insertion(+), 1 deletion(-)
 cpanfile                            |   4 -
 cpanfile.snapshot                   |  57 +----
 lib/App.pm                          |   2 +-
 lib/App/Controller/User.pm          |  43 +---
 lib/DbMapper.pm                     | 210 -----------------
 lib/DbMapper/Adapter.pm             |  12 -
 lib/DbMapper/Adapter/DBI.pm         |  90 -------
 lib/DbMapper/Adapter/DBI/Schema.pm  |  66 ------
 lib/DbMapper/Adapter/Echo.pm        |  17 --
 lib/DbMapper/Adapter/Echo/Schema.pm |  49 ----
 lib/DbMapper/Data.pm                | 179 --------------
 lib/DbMapper/DataSet.pm             | 459 ------------------------------------
 lib/DbMapper/Schema.pm              |  23 --
 lib/Mojolicious/Plugin/Auth.pm      |   1 -
 public/v2/css/authorization.css     |  11 +-
 public/v2/css/media.css             |  95 ++++++--
 public/v2/css/menu.css              |   4 +-
 public/v2/js/authorization.js       |   4 -
 t/DbMapper/create_data.t            |  22 --
 t/DbMapper/field_access.t           |  58 -----
 t/DbMapper/iterate.t                |  55 -----
 t/DbMapper/join.t                   | 223 ------------------
 t/DbMapper/lib/DSt/Role.pm          |   7 -
 t/DbMapper/lib/DSt/User.pm          |  31 ---
 t/DbMapper/lib/DSt/X1.pm            |  24 --
 t/DbMapper/lib/DSt/X2.pm            |   8 -
 t/DbMapper/update_data.t            |  15 --
 templates/v2/profile.html.ep        |  70 ++++--
 28 files changed, 153 insertions(+), 1686 deletions(-)
Successfully rebased and updated refs/heads/296_tos.
kes@work ~/s $ git tree
* f85f0623 (HEAD -> 296_tos) Fix message
* e8875a0a (origin/296_tos) Fix media queries for Profile Page
* 46a1c00b Fix media queries for screen less than 780px
* a562406d Bulk changes
* 177e2515 Bulk changes
* 934bbb31 Fix Profile Page
* 811d8812 Fix button's width on Authorization form
* 97ca9419 Fix Tariff Options page
* d5ec2336 Fix header on order page
* afcd49c1 Fix text appearance on TOS page

as you can see join.t is removed at all

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-25  7:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20 11:05 Work is not replayed on top while: git pull -v --rebase KES
2018-09-20 14:38 ` Junio C Hamano
2018-09-25  6:42   ` KES
2018-09-25  7:29     ` KES

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).