I've been working on converting all of git stash to be a builtin, however it's hard to get it all working at once with limited time, so I've moved around half of it to a new stash--helper builtin and called these functions from the shell script. Once this is stabalized, it should be easier to convert the rest of the commands one at a time without breaking anything. I've sent most of this code before, but that was targetting a full replacement of stash. The code is overall the same, but with some code review changes and updates for internal api changes. Since there seems to be interest from GSOC students who want to work on converting builtins, I figured I should finish what I have that works now so they could build on top of it. The code is based on next as write_cache_as_tree was changed to take an object ID. It can easily be rebase on master by changing the two calls to write_cache_as_tree to use tha hash. Previous threads: v1: https://public-inbox.org/git/20180325173916.GE10909@hank/T/ v2: https://public-inbox.org/git/20180326011426.19159-1-joel@xxxxxxxxxxxxx/ v3: https://public-inbox.org/git/20180327054432.26419-1-joel@xxxxxxxxxxxxx/ v4: https://public-inbox.org/git/20180328222129.22192-1-joel@xxxxxxxxxxxxx/ Changes from v4: - Fixed a typo (Thanks Eric) - Redid my test again with input from Junio - Cleaned up usages of get_oid (Thanks Junio) - Slightly reduced calls to builtin functions (rerere, rev-parse) - Added comments clarifying why when forking/cmd_* is used Joel Teichroeb (5): stash: improve option parsing test coverage stash: convert apply to builtin stash: convert drop and clear to builtin stash: convert branch to builtin stash: convert pop to builtin .gitignore | 1 + Makefile | 1 + builtin.h | 1 + builtin/stash--helper.c | 630 ++++++++++++++++++++++++++++++++++++++++++++++++ git-stash.sh | 136 +---------- git.c | 1 + t/t3903-stash.sh | 35 +++ 7 files changed, 677 insertions(+), 128 deletions(-) create mode 100644 builtin/stash--helper.c -- 2.16.3