git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Performance improvement for git pull rebase and autostash

From
Nneuling@dakosy.de <neuling@dakosy.de>
Date
Jul 10, 2017, 16:09 UTC
Message-ID
<OF9C7EC4BE.7EA71FCD-ONC1258159.003A60B3-C1258159.0058C18F@dakosy.de>
Hi,
I have some suggestions to improve performance of 'git pull --rebase'.
1. If I have no new local commits "git pull --rebase" will do a fast 
forward merge. But if I have changes to local files I have to stash them 
also if they are not affected by the new commits from origin. I think in 
that case git should not reject changes to every local file and has to use 
the fast forward merge validation instead.
2. If I have no changes to local files and I use 'git pull --rebase 
--autostash' no stashing should take place.
The improved workflow would look like as follows.
                         git pull rebase = true or preserve
                               |
                               |
                               |
                               |
                               |
                        check if local branch has no new commits
                               |
         no                    |                   yes
          ---------------------+--------------------- 
          |                                         |
          |                                         |
          |                                         |
   rebase validation                      ff merge validation for 
   for local changes                      conflicting local changes 
          |                                         |
no changes|      changes             no conflicts   |    has conflicts 
  --------+---------                    ------------+----------
  |                |                    |                     |
  |                |                    |                     |
  |                |                    |                     |
do rebase     use autostash?         do ff merge         use autostash?
  |                |                    |                     |
  |        no      |      yes           |            no       |      yes
  |        --------+---------           |            ---------+---------
  |        |                |           |            |                 |
  |        |                |           |            |                 |
  |   conflict error   stash changes    |      conflict error     stash 
changes
  |        |                |           |            |                 |
  |        |                |           |            |                 |
  |        |            do rebase       |            |            do ff 
merge
  |        |                |           |            |                 |
  |        |                |           |            |                 |
  |        |            pop stash       |            |             pop 
stash
  |        |                |           |            |                 |
  |        |                |           |            |                 |
success  abort           success     success       abort success

Regarda, Mattias

Message 1 of 1 in “Performance improvement for git pull rebase and autostash”
  1. neuling@dakosy.deJul 10, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.