summaryrefslogtreecommitdiff
path: root/git-gui/GIT-VERSION-GEN
diff options
context:
space:
mode:
authorLibravatar Phillip Wood <phillip.wood@dunelm.org.uk>2017-11-24 11:07:57 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-11-24 22:44:18 +0900
commit356ee4659bb551cd9464b317d691827276752c2d (patch)
tree910272c937ce23fbe40a4f0823a51b3d159769e4 /git-gui/GIT-VERSION-GEN
parentsequencer: load commit related config (diff)
downloadtgif-356ee4659bb551cd9464b317d691827276752c2d.tar.xz
sequencer: try to commit without forking 'git commit'
If the commit message does not need to be edited then create the commit without forking 'git commit'. Taking the best time of ten runs with a warm cache this reduces the time taken to cherry-pick 10 commits by 27% (from 282ms to 204ms), and the time taken by 'git rebase --continue' to pick 10 commits by 45% (from 386ms to 212ms) on my computer running linux. Some of greater saving for rebase is because it no longer wastes time creating the commit summary just to throw it away. The code to create the commit is based on builtin/commit.c. It is simplified as it doesn't have to deal with merges and modified so that it does not die but returns an error to make sure the sequencer exits cleanly, as it would when forking 'git commit' Even when not forking 'git commit' the commit message is written to a file and CHERRY_PICK_HEAD is created unnecessarily. This could be eliminated in future. I hacked up a version that does not write these files and just passed an strbuf (with the wrong message for fixup and squash commands) to do_commit() but I couldn't measure any significant time difference when running cherry-pick or rebase. I think eliminating the writes properly for rebase would require a bit of effort as the code would need to be restructured. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-gui/GIT-VERSION-GEN')
0 files changed, 0 insertions, 0 deletions