{"thread":{"id":"49362","subject":"git pull --rebase=preserve is always rebasing something, even on up-to-date branch","startedAt":"2018-09-17T20:35:30Z","lastAt":"2018-11-16T12:49:33Z","messageCount":2,"participants":["Mikhail Matrosov","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"358330","messageId":"CADhDkKwHp0dR7PPLV6UZDmSO9ERW7Opym3FSD64XXTg-QK65bw@mail.gmail.com","threadId":"49362","inReplyTo":null,"subject":"git pull --rebase=preserve is always rebasing something, even on up-to-date branch","fromName":"Mikhail Matrosov","fromEmail":"mikhail.matrosov@gmail.com","sentAt":"2018-09-17T20:35:19Z","receivedAt":"2018-09-17T20:35:30Z","isPatch":false,"sender":{"key":"mikhail.matrosov@gmail.com","avatar":null},"body":"Please try the following:\n\nmmatrosov@Mikhail-PC:~/test$ git init --bare server\nInitialized empty Git repository in /home/mmatrosov/test/server/\nmmatrosov@Mikhail-PC:~/test$ git clone server local\nCloning into 'local'...\nwarning: You appear to have cloned an empty repository.\ndone.\nmmatrosov@Mikhail-PC:~/test$ cd local\nmmatrosov@Mikhail-PC:~/test/local$ echo a > a && git add . && git commit -m A\n[master (root-commit) a34c21f] A\n 1 file changed, 1 insertion(+)\n create mode 100644 a\nmmatrosov@Mikhail-PC:~/test/local$ git push\nCounting objects: 3, done.\nWriting objects: 100% (3/3), 205 bytes | 0 bytes/s, done.\nTotal 3 (delta 0), reused 0 (delta 0)\nTo /home/mmatrosov/test/server\n * [new branch]      master -> master\nmmatrosov@Mikhail-PC:~/test/local$ git pull\nAlready up-to-date.\nmmatrosov@Mikhail-PC:~/test/local$ git pull --rebase=preserve\nRebasing (1/1)\nSuccessfully rebased and updated refs/heads/master.\n\nAs you can see, running bare \"git pull\" just tells me everything is up\nto date. However, running \"git pull --rebase=preserve\" triggers\nrebasing of something. It wont be a problem if it didn't take\nsignificant time (especially on Windows). Why this rebase happens? It\nis completely redundant and slows down the pull operation. Looks like\na bug to me.\n\nNote that it is important to me, because I want to set \"git config\n--global pull.rebase preserve\". But because of this issue, pulling on\nan up-to-date repository takes a lot of time. Which is very\nfrustrating.\n\nTested with:\n* git version 2.19.0.windows.1 in Windows 10 Version 1803\n* git version 2.7.4 in Ubuntu 16.04.3 LTS (inside WSL)\n\n-----\nBest regards, Mikhail Matrosov\n"},{"id":"363510","messageId":"nycvar.QRO.7.76.6.1811161345580.41@tvgsbejvaqbjf.bet","threadId":"49362","inReplyTo":"CADhDkKwHp0dR7PPLV6UZDmSO9ERW7Opym3FSD64XXTg-QK65bw@mail.gmail.com","subject":"Re: git pull --rebase=preserve is always rebasing something, even on up-to-date branch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-11-16T12:49:29Z","receivedAt":"2018-11-16T12:49:33Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Mikhail,\n\nOn Mon, 17 Sep 2018, Mikhail Matrosov wrote:\n\n> Please try the following:\n> \n> mmatrosov@Mikhail-PC:~/test$ git init --bare server\n> Initialized empty Git repository in /home/mmatrosov/test/server/\n> mmatrosov@Mikhail-PC:~/test$ git clone server local\n> Cloning into 'local'...\n> warning: You appear to have cloned an empty repository.\n> done.\n> mmatrosov@Mikhail-PC:~/test$ cd local\n> mmatrosov@Mikhail-PC:~/test/local$ echo a > a && git add . && git commit -m A\n> [master (root-commit) a34c21f] A\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 a\n> mmatrosov@Mikhail-PC:~/test/local$ git push\n> Counting objects: 3, done.\n> Writing objects: 100% (3/3), 205 bytes | 0 bytes/s, done.\n> Total 3 (delta 0), reused 0 (delta 0)\n> To /home/mmatrosov/test/server\n>  * [new branch]      master -> master\n> mmatrosov@Mikhail-PC:~/test/local$ git pull\n> Already up-to-date.\n> mmatrosov@Mikhail-PC:~/test/local$ git pull --rebase=preserve\n> Rebasing (1/1)\n> Successfully rebased and updated refs/heads/master.\n> \n> As you can see, running bare \"git pull\" just tells me everything is up\n> to date. However, running \"git pull --rebase=preserve\" triggers\n> rebasing of something.\n\nThis is most likely a `noop` command.\n\n> It wont be a problem if it didn't take significant time (especially on\n> Windows). Why this rebase happens? It is completely redundant and slows\n> down the pull operation. Looks like a bug to me.\n\nIt is an implementation detail, and if you want to work on fixing it,\nplease let me know about your availability and C skill level.\n\n> \n> Note that it is important to me, because I want to set \"git config\n> --global pull.rebase preserve\".\n\nPlease note that `preserve` is on its way to deprecation, superseded by\n`pull.rebase = merges`. Which may, or may not, share the performance\npenalty you reported. Probably not, though.\n\nCiao,\nJohannes\n\n> But because of this issue, pulling on an up-to-date repository takes a\n> lot of time. Which is very frustrating.\n> \n> Tested with:\n> * git version 2.19.0.windows.1 in Windows 10 Version 1803\n> * git version 2.7.4 in Ubuntu 16.04.3 LTS (inside WSL)\n> \n> -----\n> Best regards, Mikhail Matrosov\n> \n"}]}