From: Joel Teichroeb
Add a builtin helper for performing stash commands. Converting
all at once proved hard to review, so starting with just apply
lets conversion get started without the other commands being
finished.
The helper is being implemented as a drop in replacement for
stash so
On 2018.11.12 12:54, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin
>
> When editing patches e.g. in `git add -e`, it is quite common that a
> hunk ends up having no -/+ lines, i.e. it is now supposed to do nothing.
>
> This use case was broken by a
From: Johannes Schindelin
When editing patches e.g. in `git add -e`, it is quite common that a
hunk ends up having no -/+ lines, i.e. it is now supposed to do nothing.
This use case was broken by ad6e8ed37bc1 (apply: reject a hunk that does
not do anything, 2015-06-01) with the good intention
Jeff King writes:
> The options callback for "git apply --no-include" is not ready to handle
> the "unset" parameter, and as a result will segfault when it adds a NULL
> argument to the include list (likewise for "--no-exclude").
>
> In theory this mi
The option callback for "apply --whitespace" exits with status "1" on
error. It makes more sense for it to just return an error to
parse-options. That code will exit, too, but it will use status "129"
that is customary for option errors.
The exit() dates back to a
The options callback for "git apply --no-include" is not ready to handle
the "unset" parameter, and as a result will segfault when it adds a NULL
argument to the include list (likewise for "--no-exclude").
In theory this might be used to clear the list, but since b
/config.txt
index 5e0f76fc6e..c8d20227a8 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -297,17 +297,7 @@ include::config/alias.txt[]
include::config/am.txt[]
-apply.ignoreWhitespace::
- When set to 'change', tells 'git apply' to ignore changes
Hi Johannes,
this looks good to me, too!
Cheers,
Alban
Hi,
On Tue, 23 Oct 2018, Junio C Hamano wrote:
> SZEDER Gábor writes:
>
> >> To prevent that from happening, let's append `^0` after the stash hash,
> >> to make sure that it is interpreted as an OID rather than as a number.
> >
> > Oh, this is clever.
>
> Yeah, we can do this as we know we'd
SZEDER Gábor writes:
>> To prevent that from happening, let's append `^0` after the stash hash,
>> to make sure that it is interpreted as an OID rather than as a number.
>
> Oh, this is clever.
Yeah, we can do this as we know we'd be dealing with a commit-ish.
If we made a mistake to use a tree
On Mon, Oct 22, 2018 at 03:15:05PM -0700, Johannes Schindelin via GitGitGadget
wrote:
> From: Johannes Schindelin
>
> When `git stash apply ` sees an argument that consists only of
> digits, it tries to be smart and interpret it as `stash@{}`.
>
> Unfortunately, an all
On Mon, Oct 22, 2018 at 6:15 PM Johannes Schindelin via GitGitGadget
wrote:
> When `git stash apply ` sees an argument that consists only of
> digits, it tries to be smart and interpret it as `stash@{}`.
>
> Unfortunately, an all-digit hash (which is unlikely but still possible)
&g
From: Johannes Schindelin
When `git stash apply ` sees an argument that consists only of
digits, it tries to be smart and interpret it as `stash@{}`.
Unfortunately, an all-digit hash (which is unlikely but still possible)
is therefore misinterpreted as `stash@{}` reflog.
To prevent that from
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/apply-config.txt | 11 +++
Documentation/config.txt | 12 +---
2 files changed, 12 insertions(+), 11 deletions(-)
create mode 100644 Documentation/apply-config.txt
diff --git a/Documentation/apply-config.txt b
the line ending on save, and I exit.
>
> At this point, my source file contains a) deliberate changes I want, and b)
> whitespace changes I wish I could commit but that should not be a part of my
> patch.
>
> Shouldn't the following workflow be supported:
>
> ~> git di
wish I could commit but that should not be a part of my
patch.
Shouldn't the following workflow be supported:
~> git diff -w > foo.diff
~> git reset --hard
~> git apply [--ignore-whitespace] < foo.diff
Because that throws an error in this case:
> error: patch failed
t; + opts.reset = reset;
> > + opts.update = update;
> > + opts.fn = oneway_merge;
> > +
> > + if (unpack_trees(nr_trees, t, ))
> > + return -1;
> > +
> > + if (write_locked_index(_index, _file, COMMIT_LOCK))
> > +
+
> +static int diff_tree_binary(struct strbuf *out, struct object_id *w_commit)
> +{
> + struct child_process cp = CHILD_PROCESS_INIT;
> + const char *w_commit_hex = oid_to_hex(w_commit);
> +
> + /*
> + * Diff-tree would not be very hard to replace
refix) != hexsz ||
- get_oid_hex(patch->old_sha1_prefix, ) ||
- get_oid_hex(patch->new_sha1_prefix, ))
+ if (strlen(patch->old_oid_prefix) != hexsz ||
+ strlen(patch->new_oid_prefix) != hexsz ||
+ get_oid_hex(patch->old_oid_prefix, ) ||
+
strlen(patch->new_sha1_prefix) != hexsz ||
get_oid_hex(patch->old_sha1_prefix, ) ||
get_oid_hex(patch->new_sha1_prefix, ))
return error(_("cannot apply binary patch to '%s' "
@@ -4055,7 +4057,7 @@ static int preimage_oid_in_gitlink_patch(
From: Joel Teichroeb
Add a builtin helper for performing stash commands. Converting
all at once proved hard to review, so starting with just apply
lets conversion get started without the other commands being
finished.
The helper is being implemented as a drop in replacement for
stash so
Previous commits added some cocci rules, but did not patch the whole tree,
as to not dilute the focus for reviewing the previous patches.
This patch is generated by 'make coccicheck' and applying the resulting
diff, which was white space damaged (>8 spaces after a tab) in blame.c,
which has been
On Wed, Oct 10, 2018 at 09:58:51AM +0900, Junio C Hamano wrote:
> > +static void bitmap_to_rle(struct strbuf *out, struct bitmap *bitmap)
> > +{
> > + int curval = 0; /* count zeroes, then ones, then zeroes, etc */
> > + size_t run = 0;
> > + size_t word;
> > + size_t orig_len = out->len;
On Wed, Oct 10, 2018 at 09:48:53AM +0900, Junio C Hamano wrote:
> Jeff King writes:
>
> > The one difference is the sort order: git's diff output is
> > in tree-sort order, so a subtree "foo" sorts like "foo/",
> > which is after "foo.bar". Whereas the bitmap path list has a
> > true byte sort,
Jeff King writes:
> +static void strbuf_add_varint(struct strbuf *out, uintmax_t val)
> +{
> + size_t len;
> + strbuf_grow(out, 16); /* enough for any varint */
> + len = encode_varint(val, (unsigned char *)out->buf + out->len);
> + strbuf_setlen(out, out->len + len);
> +}
> +
>
Jeff King writes:
> The one difference is the sort order: git's diff output is
> in tree-sort order, so a subtree "foo" sorts like "foo/",
> which is after "foo.bar". Whereas the bitmap path list has a
> true byte sort, which puts "foo.bar" after "foo".
If we truly cared, it is easy enough to
The rules are basically:
- each bitmap is a series of counts of runs of 0/1
- each count is one of our standard varints
- each bitmap must have at least one initial count of
zeroes (which may itself be a zero-length count, if the
first bit is set)
- a zero-length count anywhere else
This teaches "gen" mode (formerly the only mode) to include
the list of paths, and to prefix each bitmap with its
matching oid.
The "dump" mode can then read that back in and generate the
list of changed paths. This should be almost identical to:
git rev-list --all |
git diff-tree --stdin
Signed-off-by: Jeff King
---
Makefile| 1 +
t/helper/test-tree-bitmap.c | 167
2 files changed, 168 insertions(+)
create mode 100644 t/helper/test-tree-bitmap.c
diff --git a/Makefile b/Makefile
index 13e1c52478..f6e823f2d6 100644
---
strlen(patch->new_sha1_prefix) != hexsz ||
get_oid_hex(patch->old_sha1_prefix, ) ||
get_oid_hex(patch->new_sha1_prefix, ))
return error(_("cannot apply binary patch to '%s' "
@@ -4055,7 +4057,7 @@ static int preimage_oid_in_gitlink_patch(
refix) != hexsz ||
- get_oid_hex(patch->old_sha1_prefix, ) ||
- get_oid_hex(patch->new_sha1_prefix, ))
+ if (strlen(patch->old_oid_prefix) != hexsz ||
+ strlen(patch->new_oid_prefix) != hexsz ||
+ get_oid_hex(patch->old_oid_prefix, ) ||
+
list
> > > archives, so I'm sending it again without files attached. I apologize
> > > if this is a duplicate. One should be able to reproduce this with the
> > > current PR files, but if not, I can provide them.
> > >
> > > I've hit a strange error
ched. I apologize
> > if this is a duplicate. One should be able to reproduce this with the
> > current PR files, but if not, I can provide them.
> >
> > I've hit a strange error while trying to apply a patch from github
> > here: https://github.com/openwrt/openwrt/pull/965
> >
> &g
; current PR files, but if not, I can provide them.
>
> I've hit a strange error while trying to apply a patch from github
> here: https://github.com/openwrt/openwrt/pull/965
>
> 965.patch:452: trailing whitespace.
>
> 965.patch:559: space before tab in indent.
>
trying to apply a patch from github
here: https://github.com/openwrt/openwrt/pull/965
965.patch:452: trailing whitespace.
965.patch:559: space before tab in indent.
-o $(SHLIBNAME_FULL) \
965.patch:560: space before tab in indent.
$$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS
On 09/26, Paul-Sebastian Ungureanu wrote:
> From: Joel Teichroeb
>
> Add a builtin helper for performing stash commands. Converting
> all at once proved hard to review, so starting with just apply
> lets conversion get started without the other commands being
> finished.
>
From: Joel Teichroeb
Add a builtin helper for performing stash commands. Converting
all at once proved hard to review, so starting with just apply
lets conversion get started without the other commands being
finished.
The helper is being implemented as a drop in replacement for
stash so
On Wed, Jul 25, 2018 at 5:07 PM Junio C Hamano wrote:
> Eric Sunshine writes:
> > + if (cmit_fmt_is_mail(ctx.fmt) && opt->rdiff1) {
> > + struct diff_queue_struct dq;
> > +
> > + memcpy(, _queued_diff, sizeof(diff_queued_diff));
> > +
From: Joel Teichroeb
Add a builtin helper for performing stash commands. Converting
all at once proved hard to review, so starting with just apply
lets conversion get started without the other commands being
finished.
The helper is being implemented as a drop in replacement for
stash so
On 08/08, Paul-Sebastian Ungureanu wrote:
> `apply_all_patches()` does not provide a method to apply patches
> from strbuf. Because of this, this commit introduces a new
> function `apply_patch_from_buf()` which applies a patch from buf.
> It works by saving the strbuf as a file. Thi
On Wed, Aug 8, 2018 at 9:00 PM Paul-Sebastian Ungureanu
wrote:
> + strbuf_init(>revision, 0);
> + if (!commit) {
> + if (!ref_exists(ref_stash)) {
> + free_stash_info(info);
> + fprintf_ln(stderr, "No stash entries found.");
reporting it here based on guidance from
https://git-scm.com/community.
I created a minimal testcase with a detailed README here:
https://github.com/philipmw/git-bugreport-2018-hunk-fail
Overview of the bug:
When interactively selecting hunks to apply, using `git checkout -p
`, git will correctly apply
nity.
>
> I created a minimal testcase with a detailed README here:
> https://github.com/philipmw/git-bugreport-2018-hunk-fail
>
> Overview of the bug:
>
> When interactively selecting hunks to apply, using `git checkout -p
> `, git will correctly apply an unmodified hun
have made some changes to his code and also added a lot more of
my own.
What I did was to completely convert git stash and apply some
more optimizations on top of that, like reducing the number of
spawned processes. Due to this kind of improvements I was able
to significantly reduce the exec
README here:
https://github.com/philipmw/git-bugreport-2018-hunk-fail
Overview of the bug:
When interactively selecting hunks to apply, using `git checkout -p
`, git will correctly apply an unmodified hunk, but will refuse to apply
a hunk that went through a text editor ("e" command), e
Paul-Sebastian Ungureanu writes:
>> Good to see that the right way to forward a patch from another
>> person is used, but is this a GSoC project?
>
> Yes, it is. I forgot to add the [GSoC] tag in the last series of patches.
The reason I asked was because IIRC GSoC was not supposed to be team
Hello,
On 08.08.2018 23:18, Junio C Hamano wrote:
Paul-Sebastian Ungureanu writes:
From: Joel Teichroeb
Add a builtin helper for performing stash commands. Converting
all at once proved hard to review, so starting with just apply
lets conversion get started without the other commands being
On Wed, Aug 08, 2018 at 02:35:18PM -0700, Junio C Hamano wrote:
> Back when we removed `git apply --index-info` in 2007, we forgot to
> adjust the documentation for update-index that reads its output.
>
> Let's reorder the description of three formats to present the other
&
Back when we removed `git apply --index-info` in 2007, we forgot to
adjust the documentation for update-index that reads its output.
Let's reorder the description of three formats to present the other
two formats that are still generated by git commands before this
format, and stop mentioning
Paul-Sebastian Ungureanu writes:
> From: Joel Teichroeb
>
> Add a builtin helper for performing stash commands. Converting
> all at once proved hard to review, so starting with just apply
> lets conversion get started without the other commands being
> finished.
>
`apply_all_patches()` does not provide a method to apply patches
from strbuf. Because of this, this commit introduces a new
function `apply_patch_from_buf()` which applies a patch from buf.
It works by saving the strbuf as a file. This way we can call
`apply_all_patches()`. Before returning
From: Joel Teichroeb
Add a builtin helper for performing stash commands. Converting
all at once proved hard to review, so starting with just apply
lets conversion get started without the other commands being
finished.
The helper is being implemented as a drop in replacement for
stash so
Eric Sunshine writes:
> @@ -750,6 +751,20 @@ void show_log(struct rev_info *opt)
>
> memcpy(_queued_diff, , sizeof(diff_queued_diff));
> }
> +
> + if (cmit_fmt_is_mail(ctx.fmt) && opt->rdiff1) {
> + struct diff_queue_struct dq;
> +
> + memcpy(,
e mixed feelings about this suggestion for the following reasons:
* 'struct rev_info' already contains a number of specialized fields
which apply in only certain use cases but not others, and those fields
often are grouped textually to show relationship rather than being
bundled in a struct.
*
On Sun, Jul 22, 2018 at 11:58 AM Eric Sunshine wrote:
> diff --git a/log-tree.c b/log-tree.c
> index 9d38f1cf79..56513fa83d 100644
> --- a/log-tree.c
> +++ b/log-tree.c
> @@ -14,6 +14,7 @@
> #include "sequencer.h"
> #include "line-log.h"
> #include "help.h"
> +#include "interdiff.h"
>
>
When submitting a revised version of a patch or series, it can be
helpful (to reviewers) to include a summary of changes since the
previous attempt in the form of a range-diff, typically in the cover
letter. However, it is occasionally useful, despite making for a noisy
read, to insert a
When submitting a revised version of a patch or series, it can be
helpful (to reviewers) to include a summary of changes since the
previous attempt in the form of an interdiff, typically in the cover
letter. However, it is occasionally useful, despite making for a noisy
read, to insert an
From: Joel Teichroeb
Add a builtin helper for performing stash commands. Converting
all at once proved hard to review, so starting with just apply
lets conversion get started without the other commands being
finished.
The helper is being implemented as a drop in replacement for
stash so
Signed-off-by: Elijah Newren
---
apply.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apply.c b/apply.c
index d79e61591b..85f2c92740 100644
--- a/apply.c
+++ b/apply.c
@@ -4053,7 +4053,7 @@ static int preimage_oid_in_gitlink_patch(struct patch *p,
struct object_id *oid)
Similar to 'git reset -N', this option makes 'git apply' automatically
mark new files as intent-to-add so they are visible in the following
'git diff' command and could also be committed with 'git commit -a'.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
---
Documentation/git-app
-[in]visible-in-index when diffing worktree-to-tree
diff: turn --ita-invisible-in-index on by default
t2203: add a test about "diff HEAD" case
apply: add --intent-to-add
Documentation/git-apply.txt | 10 +-
apply.c | 19 +++
apply.h
t;set_ita = 0;
>>
>> I think this should error out, just like one line above does.
>> "I-t-a" is impossible without having the index, just like "--index"
>> is impossible without having the index.
>
> I was hoping to put this in an alias th
hIpPy <hippy2...@gmail.com> writes:
> If I disable mnemonic prefix,
>
> $ git config --global diff.noprefix true
>
> and do a round-trip of format-patch and apply,
Setting diff.noprefix does not disable "mnemonic prefix". It asks
"diff" family of comma
On Mon, May 14, 2018 at 11:33:48AM +0900, Junio C Hamano wrote:
> > diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
> > index 4ebc3d3271..2374f64b51 100644
> > --- a/Documentation/git-apply.txt
> > +++ b/Documentation/git-apply.txt
> > @@
If I disable mnemonic prefix,
$ git config --global diff.noprefix true
and do a round-trip of format-patch and apply,
$ git format-patch -1 @
$ git apply
git apply fails with,
error: git diff header lacks filename information when removing 1
leading pathname component (line 16)
Without
Nguyễn Thái Ngọc Duy <pclo...@gmail.com> writes:
> Similar to 'git reset -N', this option makes 'git apply' automatically
> mark new files as intent-to-add so they are visible in the following
> 'git diff' command and could also be committed with 'git commit -a'.
>
> Signe
Similar to 'git reset -N', this option makes 'git apply' automatically
mark new files as intent-to-add so they are visible in the following
'git diff' command and could also be committed with 'git commit -a'.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
---
Documentation/git-app
Jeff King <p...@peff.net> writes:
> How about this?
>
> -- >8 --
> Subject: [PATCH] apply: clarify "-p" documentation
>
> We're not really removing slashes, but slash-separated path
> components. Let's make that more clear.
>
> Reported-by: ke
home/user/repos/myrepo with -p2 becomes user/repos/myrepo
>
> This argument seems to be removing folders from the path, not slashes.
Yes. I agree the current documentation is quite misleading.
How about this?
-- >8 --
Subject: [PATCH] apply: clarify "-p" documentation
We're
https://git-scm.com/docs/git-apply#git-apply--pltngt
> -p
> Remove leading slashes from traditional diff paths. The default is 1.
This suggests to me the following outcomes:
1) home/user/repos/myrepo with -p1 becomes home/user/repos/myrepo
2) home/user/repos/myrepo with -p2 becomes hom
This commit hooks together all the directory rename logic by making the
necessary changes to the rename struct, it's dst_entry, and the
diff_filepair under consideration.
Reviewed-by: Stefan Beller
Signed-off-by: Elijah Newren
Signed-off-by: Junio C Hamano
ARSE_OPT_KEEP_UNKNOWN|PARSE_OPT_KEEP_DASHDASH);
> +
> + index_file = get_index_file();
> + strbuf_addf(_index_path, "%s.stash.%" PRIuMAX, index_file,
> (uintmax_t)pid);
> +
> + if (argc < 1)
> + usage_with_options(git_stash_helper_usag
Hi Joel,
On Wed, 4 Apr 2018, Joel Teichroeb wrote:
> Add a bulitin helper for performing stash commands. Converting
> all at once proved hard to review, so starting with just apply
> let conversion get started without the other command being
s/let/lets the/ s/command/commands/
&
rom
> stash"));
I agree with this, as it avoids an unncessary indentation level.
> So maybe we can get rid of `result` and have something like:
>
>if (argc < 1) {
>error(_("at least one argument is required"));
>usage_with_options(git_stash_helper_us
if (argc < 1) {
>>error(_("at least one argument is required"));
>>usage_with_options(git_stash_helper_usage, options);
>
> Maybe we could also simplify these 2 lines by using usage_msg_opt().
>
>>}
>>
>>
gt;usage_with_options(git_stash_helper_usage, options);
Maybe we could also simplify these 2 lines by using usage_msg_opt().
> }
>
>if (!strcmp(argv[0], "apply"))
>return apply_stash(argc, argv, prefix);
>
>error(_("unknown subcomma
On Thu, Apr 5, 2018 at 4:28 AM, Joel Teichroeb <j...@teichroeb.net> wrote:
> Add a bulitin helper for performing stash commands. Converting
> all at once proved hard to review, so starting with just apply
> let conversion get started without the other command being
> finish
Add a bulitin helper for performing stash commands. Converting
all at once proved hard to review, so starting with just apply
let conversion get started without the other command being
finished.
The helper is being implemented as a drop in replacement for
stash so that when it is complete it can
e code was the weakest
part of my patch before. I'm very happy to have it cleaned up like
this!
>
>> +int cmd_stash__helper(int argc, const char **argv, const char *prefix)
>> +{
>> + int result = 0;
>> + pid_t pid = getpid();
>> + co
rgc, argv, prefix, options,
> git_stash_helper_usage,
> + PARSE_OPT_KEEP_UNKNOWN|PARSE_OPT_KEEP_DASHDASH);
> +
> + index_file = get_index_file();
> + xsnprintf(stash_index_path, PATH_MAX, "%s.stash.%"PRIuMAX, index_file,
> (uintmax_t)pid);
Wouldn't it make more sense to get rid of PATH_MAX and hold it in a
strbuf instead? I.e.
static struct strbuf stash_index_path = STRBUF_INIT;
...
strbuf_addf(_index_path, "%s.stash.%" PRIuMAX, index_file,
(uintmax_t)pid);
> + cd "$START_DIR"
> + git stash--helper apply "$@"
> + res=$?
> + cd_to_toplevel
> + return $res
> }
Add a bulitin helper for performing stash commands. Converting
all at once proved hard to review, so starting with just apply
let conversion get started without the other command being
finished.
The helper is being implemented as a drop in replacement for
stash so that when it is complete it can
On Mon, Mar 26, 2018 at 12:05 AM, Christian Couder
wrote:
> On Mon, Mar 26, 2018 at 3:14 AM, Joel Teichroeb wrote:
>> Signed-off-by: Joel Teichroeb
>
> The commit message in this patch and the following ones could be a bit
>
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) {
>> +
On Tue, Mar 27, 2018 at 9:02 AM, Johannes Schindelin
wrote:
> Hi Joel,
>
> [...]
>> +
>> +static int do_apply_stash(const char *prefix, struct stash_info *info, int
>> index)
>> +{
>> + struct merge_options o;
>> + struct object_id c_tree;
>> + struct
Hi Joel,
On Mon, 26 Mar 2018, Joel Teichroeb wrote:
> Add a bulitin helper for performing stash commands. Converting
> all at once proved hard to review, so starting with just apply
> let conversion get started without the other command being
> finished.
>
> The helper is
Hi Joel,
On Mon, 26 Mar 2018, Joel Teichroeb wrote:
> Add a bulitin helper for performing stash commands. Converting
> all at once proved hard to review, so starting with just apply
> let conversion get started without the other command being
> finished.
>
> The helper is
Add a bulitin helper for performing stash commands. Converting
all at once proved hard to review, so starting with just apply
let conversion get started without the other command being
finished.
The helper is being implemented as a drop in replacement for
stash so that when it is complete it can
On Mon, Mar 26, 2018 at 3:14 AM, Joel Teichroeb wrote:
> Signed-off-by: Joel Teichroeb
The commit message in this patch and the following ones could be a bit
more verbose. It could at least tell that the end goal is to convert
git-stash.sh to a C builtin.
clude "refs.h"
+#include "lockfile.h"
+#include "cache-tree.h"
+#include "unpack-trees.h"
+#include "merge-recursive.h"
+#include "argv-array.h"
+#include "run-command.h"
+#include "dir.h"
+
+static const cha
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
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;
> +
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
_cache(REFRESH_QUIET))
> + return -1;
> +
> + if (write_cache_as_tree(c_tree.hash, 0, NULL) || reset_tree(c_tree, 0,
> 0))
> + return error(_("Cannot apply a stash in the middle of a
> merge"));
> +
> + if (index) {
> + if (!oidcmp(>
t;> + argv_array_pushf(, "%s^2^..%s^2",
>> sha1_to_hex(info->w_commit.hash), sha1_to_hex(info->w_commit.hash));
>> + if (pipe_command(, NULL, 0, , 0, NULL, 0))
>> + return -1;
>
> Leak
On Sat, Mar 24, 2018 at 6:37 PM, Joel Teichroeb <j...@teichroeb.net> 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)
>
ipe_command(, NULL, 0, , 0, NULL, 0))
> + return -1;
Leaking 'out'?
> +
> + child_process_init();
> + cp.git_cmd = 1;
> + argv_array_pushl(, "apply", "--cached", NULL);
> +
> + 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;
>
+#include "cache-tree.h"
+#include "unpack-trees.h"
+#include "merge-recursive.h"
+#include "argv-array.h"
+#include "run-command.h"
+#include "dir.h"
+
+static const char * const git_stash_helper_usage[] = {
+ N_("git stash--h
Use is_null_oid() instead of is_null_sha1()
---
This is just a fixup to patch 23/29 in my v8 series for detecting directory
renames;
should squash cleanly.
merge-recursive.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index
Brandon Williams writes:
> Update the documentation for the 'submodule.recurse' config to identify
> that the clone command does not respect it.
>
> Signed-off-by: Brandon Williams
> ---
> Documentation/config.txt | 3 ++-
> 1 file changed, 2
1 - 100 of 1532 matches
Mail list logo