{"thread":{"id":"55552","subject":"git pull --rebase silently skipping commits","startedAt":"2021-04-24T13:46:25Z","lastAt":"2021-04-24T13:46:25Z","messageCount":1,"participants":["Alejandro Colomar (man-pages)"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"422855","messageId":"17e490f6-c393-0232-3236-3c1758b8bd25@gmail.com","threadId":"55552","inReplyTo":null,"subject":"git pull --rebase silently skipping commits","fromName":"Alejandro Colomar (man-pages)","fromEmail":"alx.manpages@gmail.com","sentAt":"2021-04-24T13:46:12Z","receivedAt":"2021-04-24T13:46:25Z","isPatch":false,"sender":{"key":"alx.manpages@gmail.com","avatar":null},"body":"Hello,\n\nI started my PC and as always did a 'git fetch'.  I noticed that I \nforgot to push a commit the other day, so I had the following situation:\n\nalx@msi:~/src/alx/config$ git tree -8\n* 226e73c - Thu, 22 Apr 2021 22:28:37 +0200 (2 days ago) (tag: v0.8.0, \norigin/main, origin/HEAD)\n|           Makefile: ffix - Alejandro Colomar\n* 29cac15 - Thu, 22 Apr 2021 22:21:56 +0200 (2 days ago)\n|           Makefile: remove unused option of read - Alejandro Colomar\n* 5adc827 - Thu, 22 Apr 2021 22:20:16 +0200 (2 days ago)\n|           Makefile: use INSTALL_DATA instead of plain install - \nAlejandro Colomar\n* 28df09e - Thu, 22 Apr 2021 22:12:40 +0200 (2 days ago)\n|           Makefile: Don't hardcode things - Alejandro Colomar\n* 9cdb873 - Thu, 22 Apr 2021 22:11:32 +0200 (2 days ago)\n|           ssh: Simplify code, and don't overwrite other contents of \n.ssh/config - Alejandro Colomar\n| * 4d2f5ad - Thu, 22 Apr 2021 19:22:16 +0200 (2 days ago) (HEAD -> main)\n|/            sudo: Rename user alex to alx - Alejandro Colomar\n* ad1d205 - Thu, 22 Apr 2021 12:51:10 +0200 (2 days ago) (tag: v0.7.0)\n|           hosts: Don't overwrite the hole file - Alejandro Colomar\n* c5137b5 - Wed, 21 Apr 2021 14:14:34 +0200 (3 days ago) (tag: v0.6.2)\n|           Makefile: ffix - Alejandro Colomar\nalx@msi:~/src/alx/config$\n\n\n\nNormally I would've run 'git rebase origin/main', but recently I knew \nabout 'git pull --rebase', so I was tried it.  However, to my surprise, \nit silently skipped the local commit:\n\nalx@msi:~/src/alx/config$ git pull --rebase\nSuccessfully rebased and updated refs/heads/main.\nalx@msi:~/src/alx/config$ git tree -8\n* 226e73c - Thu, 22 Apr 2021 22:28:37 +0200 (2 days ago) (HEAD -> main, \ntag: v0.8.0, origin/main, origin/HEAD)\n|           Makefile: ffix - Alejandro Colomar\n* 29cac15 - Thu, 22 Apr 2021 22:21:56 +0200 (2 days ago)\n|           Makefile: remove unused option of read - Alejandro Colomar\n* 5adc827 - Thu, 22 Apr 2021 22:20:16 +0200 (2 days ago)\n|           Makefile: use INSTALL_DATA instead of plain install - \nAlejandro Colomar\n* 28df09e - Thu, 22 Apr 2021 22:12:40 +0200 (2 days ago)\n|           Makefile: Don't hardcode things - Alejandro Colomar\n* 9cdb873 - Thu, 22 Apr 2021 22:11:32 +0200 (2 days ago)\n|           ssh: Simplify code, and don't overwrite other contents of \n.ssh/config - Alejandro Colomar\n* ad1d205 - Thu, 22 Apr 2021 12:51:10 +0200 (2 days ago) (tag: v0.7.0)\n|           hosts: Don't overwrite the hole file - Alejandro Colomar\n* c5137b5 - Wed, 21 Apr 2021 14:14:34 +0200 (3 days ago) (tag: v0.6.2)\n|           Makefile: ffix - Alejandro Colomar\n* 5244a5c - Wed, 21 Apr 2021 14:12:05 +0200 (3 days ago) (tag: v0.6.1)\n|           sshd: restart service after installing - Alejandro Colomar\nalx@msi:~/src/alx/config$\n\n\nWhen trying 'git pull --rebase=interactive', I see the following:\n\nnoop \n\n \n\n# Rebase 4d2f5ad..4d2f5ad onto 226e73c (1 command)\n\n\nI'd expect 'git pull --rebase' to be an equivalent of 'git fetch origin \n&& git rebase origin/main'.  But this time I had to use rebase:\n\nalx@msi:~/src/alx/config$ git reset 4d2f --h\nHEAD is now at 4d2f5ad sudo: Rename user alex to alx\nalx@msi:~/src/alx/config$ git tree -8\n* 226e73c - Thu, 22 Apr 2021 22:28:37 +0200 (2 days ago) (tag: v0.8.0, \norigin/main, origin/HEAD)\n|           Makefile: ffix - Alejandro Colomar\n* 29cac15 - Thu, 22 Apr 2021 22:21:56 +0200 (2 days ago)\n|           Makefile: remove unused option of read - Alejandro Colomar\n* 5adc827 - Thu, 22 Apr 2021 22:20:16 +0200 (2 days ago)\n|           Makefile: use INSTALL_DATA instead of plain install - \nAlejandro Colomar\n* 28df09e - Thu, 22 Apr 2021 22:12:40 +0200 (2 days ago)\n|           Makefile: Don't hardcode things - Alejandro Colomar\n* 9cdb873 - Thu, 22 Apr 2021 22:11:32 +0200 (2 days ago)\n|           ssh: Simplify code, and don't overwrite other contents of \n.ssh/config - Alejandro Colomar\n| * 4d2f5ad - Thu, 22 Apr 2021 19:22:16 +0200 (2 days ago) (HEAD -> main)\n|/            sudo: Rename user alex to alx - Alejandro Colomar\n* ad1d205 - Thu, 22 Apr 2021 12:51:10 +0200 (2 days ago) (tag: v0.7.0)\n|           hosts: Don't overwrite the hole file - Alejandro Colomar\n* c5137b5 - Wed, 21 Apr 2021 14:14:34 +0200 (3 days ago) (tag: v0.6.2)\n|           Makefile: ffix - Alejandro Colomar\nalx@msi:~/src/alx/config$ git rebase origin/main\nSuccessfully rebased and updated refs/heads/main.\nalx@msi:~/src/alx/config$ git tree -8\n* 72f6ab9 - Thu, 22 Apr 2021 19:22:16 +0200 (2 days ago) (HEAD -> main)\n|           sudo: Rename user alex to alx - Alejandro Colomar\n* 226e73c - Thu, 22 Apr 2021 22:28:37 +0200 (2 days ago) (tag: v0.8.0, \norigin/main, origin/HEAD)\n|           Makefile: ffix - Alejandro Colomar\n* 29cac15 - Thu, 22 Apr 2021 22:21:56 +0200 (2 days ago)\n|           Makefile: remove unused option of read - Alejandro Colomar\n* 5adc827 - Thu, 22 Apr 2021 22:20:16 +0200 (2 days ago)\n|           Makefile: use INSTALL_DATA instead of plain install - \nAlejandro Colomar\n* 28df09e - Thu, 22 Apr 2021 22:12:40 +0200 (2 days ago)\n|           Makefile: Don't hardcode things - Alejandro Colomar\n* 9cdb873 - Thu, 22 Apr 2021 22:11:32 +0200 (2 days ago)\n|           ssh: Simplify code, and don't overwrite other contents of \n.ssh/config - Alejandro Colomar\n* ad1d205 - Thu, 22 Apr 2021 12:51:10 +0200 (2 days ago) (tag: v0.7.0)\n|           hosts: Don't overwrite the hole file - Alejandro Colomar\n* c5137b5 - Wed, 21 Apr 2021 14:14:34 +0200 (3 days ago) (tag: v0.6.2)\n|           Makefile: ffix - Alejandro Colomar\nalx@msi:~/src/alx/config$\n\n\nI wonder if it may be due to this text, which I don't really understand:\n\nalx@msi:~$ man git-pull | sed -n '/-r, --rebase/,/^$/p'\n        -r, --rebase[=false|true|merges|preserve|interactive]\n            When true, rebase the current branch on top of the\n            upstream branch after fetching. If there is a\n            remote-tracking branch corresponding to the upstream\n            branch and the upstream branch was rebased since last\n            fetched, the rebase uses that information to avoid\n            rebasing non-local changes.\n\nWhat does it mean \"the upstream branch was rebased since last fetched\"?\nMay it be the reason that it skipped that commit?  Isn't 'git pull \n--rebase' designed for what I'm using it?  In this case it's not really \nnecessary, but it removes the need for specifying the branch I'm on, \nwhich is why I preferred it over 'git rebase'.\n\n\nThanks,\n\nAlex\n\n-- \nAlejandro Colomar\nLinux man-pages comaintainer; https://www.kernel.org/doc/man-pages/\nSenior SW Engineer; http://www.alejandro-colomar.es/\n"}]}