Re: [PATCH v6 3/4] stash: convert branch to builtin

2018-06-28 Thread Paul-Sebastian Ungureanu
Hello, On 27.06.2018 21:39, Junio C Hamano wrote: This is primarily because cmd_$foo() is designed to be replacement of "main()" in usual programs---it is allowed to assume the global variables it uses have their initial values and nobody cares the state it leaves behind when it returns. Argume

Re: [PATCH v6 3/4] stash: convert branch to builtin

2018-06-27 Thread Junio C Hamano
Johannes Schindelin writes: >> +ret = cmd_checkout(args.argc, args.argv, prefix); > > I guess it is okay to run that, but the cmd_() functions are not *really* > meant to be called this way... Personally, I would be more comfortable > with a `run_command()` here, i.e. with a spawned process,

Re: [PATCH v6 3/4] stash: convert branch to builtin

2018-06-26 Thread Johannes Schindelin
Hi Paul, On Mon, 25 Jun 2018, Paul-Sebastian Ungureanu wrote: > diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c > index 84a537f39..fbf78249c 100644 > --- a/builtin/stash--helper.c > +++ b/builtin/stash--helper.c > @@ -522,6 +528,41 @@ static int drop_stash(int argc, const char **ar

[PATCH v6 3/4] stash: convert branch to builtin

2018-06-25 Thread Paul-Sebastian Ungureanu
From: Joel Teichroeb Add stash branch to the helper and delete the apply_to_branch function from the shell script. Checkout does not currently provide a function for checking out a branch as cmd_checkout does a large amount of sanity checks first that we require here. Signed-off-by: Joel Teichr