Re: [PATCH 1/4] stash: convert apply to builtin

2018-03-27 Thread Joel Teichroeb
On Sun, Mar 25, 2018 at 9:43 AM, Thomas Gummerer wrote: > On 03/24, Joel Teichroeb wrote: >> --- > > Missing sign-off? I saw it's missing in the other patches as well. > Thanks! I always forget to add a sign-off. >> [...] >> + >> + if (info->has_u) { >> +

Re: [PATCH 1/4] stash: convert apply to builtin

2018-03-25 Thread Christian Couder
On Sun, Mar 25, 2018 at 6:51 PM, Joel Teichroeb wrote: > On Sun, Mar 25, 2018 at 1:09 AM, Christian Couder > wrote: >> It seems to me that the apply_stash() shell function is also used in >> pop_stash() and in apply_to_branch(). Can the new helper

Re: [PATCH 1/4] stash: convert apply to builtin

2018-03-25 Thread Thomas Gummerer
On 03/24, Joel Teichroeb wrote: > --- > [...] > + > +static const char *ref_stash = "refs/stash"; > +static int quiet; > +static char stash_index_path[PATH_MAX]; > + > +struct stash_info { > + struct object_id w_commit; > + struct object_id b_commit; > + struct object_id i_commit; > +

Re: [PATCH 1/4] stash: convert apply to builtin

2018-03-25 Thread Joel Teichroeb
On Sun, Mar 25, 2018 at 1:09 AM, Christian Couder wrote: > It seems to me that the apply_stash() shell function is also used in > pop_stash() and in apply_to_branch(). Can the new helper be used there > too instead of apply_stash()? And then could apply_stash() be

Re: [PATCH 1/4] stash: convert apply to builtin

2018-03-25 Thread Thomas Gummerer
On 03/24, Joel Teichroeb wrote: > --- Missing sign-off? I saw it's missing in the other patches as well. > [...] > +static int do_apply_stash(const char *prefix, struct stash_info *info, int > index) > +{ > + struct merge_options o; > + struct object_id c_tree; > + struct

Re: [PATCH 1/4] stash: convert apply to builtin

2018-03-25 Thread Christian Couder
On Sun, Mar 25, 2018 at 8:40 AM, Eric Sunshine wrote: > On Sat, Mar 24, 2018 at 1:37 PM, Joel Teichroeb wrote: >> +static int do_apply_stash(const char *prefix, struct stash_info *info, int >> index) >> +{ >> + if (index) { >> +

Re: [PATCH 1/4] stash: convert apply to builtin

2018-03-25 Thread Christian Couder
On Sat, Mar 24, 2018 at 6:37 PM, Joel Teichroeb wrote: > diff --git a/git-stash.sh b/git-stash.sh > index fc8f8ae640..92c084eb17 100755 > --- a/git-stash.sh > +++ b/git-stash.sh > @@ -711,7 +711,8 @@ push) > ;; > apply) > shift > - apply_stash "$@" > +

Re: [PATCH 1/4] stash: convert apply to builtin

2018-03-25 Thread Eric Sunshine
On Sat, Mar 24, 2018 at 1:37 PM, Joel Teichroeb wrote: > diff --git a/builtin/stash--helper.c b/builtin/stash--helper.c > @@ -0,0 +1,339 @@ > +static int get_stash_info(struct stash_info *info, const char *commit) > +{ > + struct strbuf w_commit_rev = STRBUF_INIT; > +

Re: [PATCH 1/4] stash: convert apply to builtin

2018-03-24 Thread Christian Couder
> + if (unpack_trees(nr_trees, t, )) > + return -1; > + > + if (write_locked_index(_index, _file, COMMIT_LOCK)) { > + error(_("unable to write new index file")); > + return -1; Maybe: return error(...); > + } > + > + return 0; >

[PATCH 1/4] stash: convert apply to builtin

2018-03-24 Thread Joel Teichroeb
--- .gitignore | 1 + Makefile| 1 + builtin.h | 1 + builtin/stash--helper.c | 339 git-stash.sh| 3 +- git.c | 1 + 6 files changed, 345 insertions(+), 1