/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'
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-di
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
xes up 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:
>
space changes I 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:
>
t; > + opts.reset = reset;
> > + opts.update = update;
> > + opts.fn = oneway_merge;
> > +
> > + if (unpack_trees(nr_trees, t, &opts))
> > + return -1;
> > +
> > + if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
> > +
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 with a native function,
> + * however it shoul
trlen(patch->new_sha1_prefix) != hexsz ||
- get_oid_hex(patch->old_sha1_prefix, &oid) ||
- get_oid_hex(patch->new_sha1_prefix, &oid))
+ if (strlen(patch->old_oid_prefix) != hexsz ||
+ strlen(patch->new_oid_prefix) != hexsz ||
+
ha1_prefix) != hexsz ||
+ strlen(patch->new_sha1_prefix) != hexsz ||
get_oid_hex(patch->old_sha1_prefix, &oid) ||
get_oid_hex(patch->new_sha1_prefix, &oid))
return error(_("cannot apply binary patch to '%s
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 that
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 f
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 fi
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 m
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 --n
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
--- a/
ha1_prefix) != hexsz ||
+ strlen(patch->new_sha1_prefix) != hexsz ||
get_oid_hex(patch->old_sha1_prefix, &oid) ||
get_oid_hex(patch->new_sha1_prefix, &oid))
return error(_("cannot apply binary patch to '%s
trlen(patch->new_sha1_prefix) != hexsz ||
- get_oid_hex(patch->old_sha1_prefix, &oid) ||
- get_oid_hex(patch->new_sha1_prefix, &oid))
+ if (strlen(patch->old_oid_prefix) != hexsz ||
+ strlen(patch->new_oid_prefix) != hexsz ||
+
it in the 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
ed. 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/9
is 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
>
> 965.patch:452: trailing whitespace.
>
> 965.patch:559: space before tab in inde
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.
-o $(SHLIBNAME_FULL) \
965.patch:560: space before tab in indent.
$$ALLSYMSFLAGS $$SHOBJE
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 that
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(&dq, &diff_queued_diff, sizeof(diff_queued_diff));
> > + DIFF_QUEUE_CLE
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 that
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(&info->revision, 0);
> + if (!commit) {
> + if (!ref_exists(ref_stash)) {
> + free_stash_info(info);
> + fprintf_ln(stderr, "No stash entries found."
) I’m 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
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 execution tim
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
eff
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 menti
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, the
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 that
Eric Sunshine writes:
> @@ -750,6 +751,20 @@ void show_log(struct rev_info *opt)
>
> memcpy(&diff_queued_diff, &dq, sizeof(diff_queued_diff));
> }
> +
> + if (cmit_fmt_is_mail(ctx.fmt) && opt->rdiff1) {
> + struct diff_queue_struct dq;
> +
> + mem
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 stru
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"
>
> static
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 range-diff
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 interdiff
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 that
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 Du
gnore --ita-[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
gt;> 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 that works both with or without
hIpPy 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 commands to use no prefix, not ev
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
> > @@ -9
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 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
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 Du
Jeff King 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: kelly elton
>
o
> 2) 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" documentati
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
---
merge-recursive.c
ARSE_OPT_KEEP_UNKNOWN|PARSE_OPT_KEEP_DASHDASH);
> +
> + index_file = get_index_file();
> + strbuf_addf(&stash_index_path, "%s.stash.%" PRIuMAX, index_file,
> (uintmax_t)pid);
> +
> + if (argc < 1)
> + usage_with_options(git_stash_helper_
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/
&
ld not restore untracked files from
> 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"));
or(_("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().
>
>>}
>>
>>if (!strcmp(argv[0], "apply"))
>>
sage, 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 subcommand: %s"), argv[0]);
>usage_with_options(git_stash_helper_usage, options);
> }
On Thu, Apr 5, 2018 at 4:28 AM, 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 bein
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
cleaned up like
this!
>
>> +int cmd_stash__helper(int argc, const char **argv, const char *prefix)
>> +{
>> + int result = 0;
>> + pid_t pid = getpid();
>> + const char *index_file;
>> +
>> + struct option options[] = {
>> + OPT_END()
>> + };
>> +
>> + git_config(git_default_config, NULL);
>> +
>> + argc = parse_options(argc, 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(&stash_index_path, "%s.stash.%" PRIuMAX, index_file,
> (uintmax_t)pid);
>
That makes it a lot cleaner, thanks!
>> + cd "$START_DIR"
>> + git stash--helper apply "$@"
>> + res=$?
>> + cd_to_toplevel
>> + return $res
>> }
= getpid();
> + const char *index_file;
> +
> + struct option options[] = {
> + OPT_END()
> + };
> +
> + git_config(git_default_config, NULL);
> +
> + argc = parse_options(argc, 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(&stash_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
> more verbose. It could at least tell that the end goal is to convert
>
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) {
>> + struct child_process cp
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 object_id index_tree;
>> + co
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 bein
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 bein
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.
> +static void destroy_stash_info(struc
+#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 char * const git_stash_helper_usage[] = {
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 be used there
>> too instead of apply_stash()? An
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 remove?
I wasn't really sure if
ESH_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) {
> +
t;> + argv_array_pushf(&cp.args, "%s^2^..%s^2",
>> sha1_to_hex(info->w_commit.hash), sha1_to_hex(info->w_commit.hash));
>> + if (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0))
>> + retu
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 &q
sh));
> + if (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0))
> + return -1;
Leaking 'out'?
> +
> + child_process_init(&cp);
> + cp.git_cmd = 1;
> +
> + if (unpack_trees(nr_trees, t, &opts))
> + return -1;
> +
> + if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK)) {
> + error(_("unable to write new index file"));
> + return -1;
Maybe: return error(...);
> + }
> +
> +
+#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 ffe1
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 insertions(+), 1 deletion(-)
Thanks.
> diff --git
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 insertions(+), 1 deletion(-)
diff --git a/Documentation/config.txt b/Documentation/config.t
On Wed, Jan 31, 2018 at 12:25 AM, Elijah Newren wrote:
> 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.
>
> Signed-off-by: Elijah Newren
> ---
> merge-recursive.c
Johannes Schindelin writes:
> } else {
> - if (!starts_with(line, "/dev/null\n"))
> + if (!is_dev_null(line))
> return error(_("git apply: bad git-diff - expected
> /dev/null on line %d"), state->linenr);
Subversion generates diffs that contain funny ---/+++ lines containing
more than just the file names. Example:
--- a/trunk/README (revision 4711)
+++ /dev/null (nonexistent)
Let's add a test case demonstrating that apply cannot handle the
/dev/null line (although i
From: Tatyana Krasnukha
Subversion generates diffs that can contain lines like this one:
--- /dev/null (nonexistent)
Let's teach Git's apply machinery to handle such a line gracefully.
This fixes https://github.com/git-for-windows/git/isues/1489
Signed-off-by: Tatyana
et's handle
the case gracefully where the diff contains a "--- /dev/null" line with a
trailing comment.
This contribution came in via Pull Request to Git for Windows, from a first
time contributor! Yes!
Johannes Schindelin (1):
apply: demonstrate a problem applying svn diffs
Tat
101 - 200 of 1632 matches
Mail list logo