* Re: [PATCH 2/3] t0001: work around the bug that reads config file before repo setup
From: Jeff King @ 2016-09-08 20:02 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git, git, max.nordlund
In-Reply-To: <20160908134719.27955-3-pclouds@gmail.com>
On Thu, Sep 08, 2016 at 08:47:18PM +0700, Nguyễn Thái Ngọc Duy wrote:
> git-init somehow reads '.git/config' at current directory and sets
> log_all_ref_updates based on this file. Because log_all_ref_updates is
> not unspecified (-1) any more. It will not be written to the new repo's
> config file (see create_default_files() function).
>
> This will affect our tests in the next patch as we will compare the
> config file and expect that core.logallrefupdates is already set to true
> by "git init main-worktree".
This is a bug for more than worktrees, and is something I'm working on
fixing (what I'd like to do is kill off the lazy fallback to ".git/" as
the repo name, which is almost always the wrong thing to do).
I'm not opposed to your workaround, but just FYI.
-Peff
^ permalink raw reply
* Re: [PATCH 2/3] checkout.txt: document a common case that ignores ambiguation rules
From: Junio C Hamano @ 2016-09-08 20:03 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git
In-Reply-To: <20160907111941.2342-3-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> Normally we err on the safe side: if something can be seen as both an
> SHA1 and a pathspec, we stop and scream. In checkout, there is one
> exception added in 859fdab (git-checkout: improve error messages, detect
> ambiguities. - 2008-07-23), to allow the common case "git checkout
> branch". Let's document this exception.
Good idea, but...
> +ARGUMENT AMBIGUATION
> +--------------------
> +
> +When there is only one argument given and it is not `--` (e.g. "git
> +checkout abc"), "abc" could be seen as either a `<tree-ish>` or a
> +`<pathspec>`, but Git will assume the argument is a `<tree-ish>`, which is
> +a common case for switching branches. Use `git checkout -- <pathspec>`
> +form if you mean it to be a pathspec.
... this is far from reasonable. I'd read "but Git will assume the
argument is a tree-ish" to mean "git checkout Makefile" would
attempt to checkout the Makefile branch and fail.
When there is only one argument given and it is not `--` (e.g. "git
checkout abc"), and when the argument is both a valid `<tree-ish>`
(e.g. a branch "abc" exists) and a valid `<pathspec>` (e.g. a file
or a directory whose name is "abc" exists), Git would usually ask
you to disambiguate. Because checking out a branch is so common an
operation, however, "git checkout abc" takes "abc" as a `<tree-ish>`
in such situation. Use `git checkout -- <pathspec>` if you want to
checkout these paths out of the index.
or something like that?
^ permalink raw reply
* Re: [PATCH] gpg-interface: reflect stderr to stderr
From: Jeff King @ 2016-09-08 20:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Michael J Gruber, Johannes Schindelin, git
In-Reply-To: <xmqqwpimgso6.fsf@gitster.mtv.corp.google.com>
On Thu, Sep 08, 2016 at 11:20:09AM -0700, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > On Wed, Sep 07, 2016 at 10:27:34AM +0200, Michael J Gruber wrote:
> >
> >> Now, I can't reproduce C on Linux[*], so there is more involved. It
> >> could be that my patch just exposes a problem in our start_command()
> >> etc.: run-command.c contains a lot of ifdefing, so possibly quite
> >> different code is run on different platforms.
> >
> > Maybe, though my blind guess is that it is simply that on Linux we can
> > open /dev/tty directly, and console-IO on Windows is a bit more
> > complicated.
>
> True.
>
> Even though this patch is fixing only one of the two issues, I am
> tempted to say that we should queue it for now, as it does so
> without breaking a bigger gain made by the original, i.e. we learn
> the status of verification in a way the authors of GPG wants us to,
> while somebody figuires out what the best way is to show the prompt
> to the console on Windows.
That's OK by me, but I don't know if we can put off the "best way to
show the prompt" fix. It seems like a pretty serious regression for
people on Windows.
-Peff
^ permalink raw reply
* Re: [PATCH 3/3] checkout: fix ambiguity check in subdir
From: Junio C Hamano @ 2016-09-08 20:04 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git
In-Reply-To: <20160907111941.2342-4-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> The two functions in parse_branchname_arg(), verify_non_filename and
> check_filename, need correct prefix in order to reconstruct the paths
> and check for their existence. With NULL prefix, they just check paths
> at top dir instead.
Good eyes. Will queue.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> builtin/checkout.c | 4 ++--
> t/t2010-checkout-ambiguous.sh | 9 +++++++++
> t/t2024-checkout-dwim.sh | 12 ++++++++++++
> 3 files changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index 1f71d06..53c7284 100644
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -985,7 +985,7 @@ static int parse_branchname_arg(int argc, const char **argv,
> int recover_with_dwim = dwim_new_local_branch_ok;
>
> if (!has_dash_dash &&
> - (check_filename(NULL, arg) || !no_wildcard(arg)))
> + (check_filename(opts->prefix, arg) || !no_wildcard(arg)))
> recover_with_dwim = 0;
> /*
> * Accept "git checkout foo" and "git checkout foo --"
> @@ -1046,7 +1046,7 @@ static int parse_branchname_arg(int argc, const char **argv,
> * it would be extremely annoying.
> */
> if (argc)
> - verify_non_filename(NULL, arg);
> + verify_non_filename(opts->prefix, arg);
> } else {
> argcount++;
> argv++;
> diff --git a/t/t2010-checkout-ambiguous.sh b/t/t2010-checkout-ambiguous.sh
> index e76e84a..2e47fe0 100755
> --- a/t/t2010-checkout-ambiguous.sh
> +++ b/t/t2010-checkout-ambiguous.sh
> @@ -41,6 +41,15 @@ test_expect_success 'check ambiguity' '
> test_must_fail git checkout world all
> '
>
> +test_expect_success 'check ambiguity in subdir' '
> + mkdir sub &&
> + # not ambiguous because sub/world does not exist
> + git -C sub checkout world ../all &&
> + echo hello >sub/world &&
> + # ambiguous because sub/world does exist
> + test_must_fail git -C sub checkout world ../all
> +'
> +
> test_expect_success 'disambiguate checking out from a tree-ish' '
> echo bye > world &&
> git checkout world -- world &&
> diff --git a/t/t2024-checkout-dwim.sh b/t/t2024-checkout-dwim.sh
> index 468a000..3e5ac81 100755
> --- a/t/t2024-checkout-dwim.sh
> +++ b/t/t2024-checkout-dwim.sh
> @@ -174,6 +174,18 @@ test_expect_success 'checkout of branch with a file having the same name fails'
> test_branch master
> '
>
> +test_expect_success 'checkout of branch with a file in subdir having the same name fails' '
> + git checkout -B master &&
> + test_might_fail git branch -D spam &&
> +
> + >spam &&
> + mkdir sub &&
> + mv spam sub/spam &&
> + test_must_fail git -C sub checkout spam &&
> + test_must_fail git rev-parse --verify refs/heads/spam &&
> + test_branch master
> +'
> +
> test_expect_success 'checkout <branch> -- succeeds, even if a file with the same name exists' '
> git checkout -B master &&
> test_might_fail git branch -D spam &&
^ permalink raw reply
* Re: [PATCH] Move format-patch base commit and prerequisites before email signature
From: Jeff King @ 2016-09-08 20:08 UTC (permalink / raw)
To: Josh Triplett; +Cc: Junio C Hamano, git
In-Reply-To: <20160908185408.5qtfnztjbastlrtw@x>
On Thu, Sep 08, 2016 at 11:54:08AM -0700, Josh Triplett wrote:
> > your problem description
> > looks perfect. I am still not sure if the code does a reasonable
> > thing in MIME case, though.
>
> It *looks* correct to me.
Hmm. It looks correct to me, too; we stick it just after the patch, so
with "--attach" it is part of the text/x-patch, which is reasonable.
But looking at the results of "--attach" from _before_ your patch, it
looks totally broken. The "base" information comes _after the final
delimiter of the multipart/mixed. Most mailers would just throw it away
when decoding the multipart, I think.
So this is actually fixing a bug, and you could probably add a test
(though I am not sure we have anything in git that actually parses
multipart messages _or_ that carefully consumes the base-commit info, so
it might be hard to test in practice).
-Peff
^ permalink raw reply
* Re: [PATCH v2] t/Makefile: add a rule to re-run previously-failed tests
From: Junio C Hamano @ 2016-09-08 20:34 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Sverre Rabbelier, Jeff King, Git
In-Reply-To: <alpine.DEB.2.20.1609020933430.129229@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> On Thu, 1 Sep 2016, Junio C Hamano wrote:
>
>> Hopefully that [patch removing the -<pid> suffix] would help making
>> Dscho's "what are the failed tests?" logic simpler.
>
> Of course.
>
> It also makes sure that those 2 hours I spent on writing and perfecting
> the sed magic were spent in vain... ;-)
Well it is either
* the sed magic is so arcane that you'd need to spend a long time,
comparable to 2 hours you already spent, if you ever need to look
at it and figure out what it does next time you need to change
something in it.
or
* you are not familiar with the sed magic and you would be able to
write the same thing in 2 minutes next time if you need to adjust
it when we add -pid back later.
Either way, those 2 hours are not wasted.
I personally fall into the former category. Any sed script that
needs G, h, and x together I need to spend at least 15 minutes just
to warm myself up, as I do not work with the language that often.
Thanks ;-)
^ permalink raw reply
* Re: [PATCH 4/5] versioncmp: pass full tagnames to swap_prereleases()
From: SZEDER Gábor @ 2016-09-08 20:37 UTC (permalink / raw)
To: Junio C Hamano
Cc: Jeff King, Leho Kraav, Nguyễn Thái Ngọc Duy, git
In-Reply-To: <xmqq7fami8nj.fsf@gitster.mtv.corp.google.com>
Quoting Junio C Hamano <gitster@pobox.com>:
> SZEDER Gábor <szeder@ira.uka.de> writes:
>
>> - * Note that we don't have to deal with the situation when both p1 and
>> - * p2 start with the same suffix because the common part is already
>> + * Note that we don't have to deal with the situation when both s1 and
>> + * s2 contain the same suffix because the common part is already
>> * consumed by the caller.
>
> "The common part is already consumed" was relevant while the
> function was fed p1 and p2, i.e. the first difference, but the whole
> point of passing the original s1 and s2 with ofs is so that the
> function can look behind ofs as necessary. Is "already consumed"
> still correct (or relevant) with s/p/s/ you did to its calling
> convention?
Well, it's still correct in the sense that we don't have to worry about
finding the same suffix in both strings. However, "consume" is not the
right word to use here, as incrementing an offset until it points past
the common part doesn't count as "consumption", so more rewording would
be necessary.
I'm not sure about the relevancy of this pararaph, or the relevancy of
the original version for that matter. I mean, there is a different
character for sure, so it's really rather obvious that it can't
possibly be the same suffix in both, isn't it? So I don't think it
adds much value, and don't mind deleting it in the reroll.
Best,
Gábor
^ permalink raw reply
* [PATCH] checkout: eliminate unnecessary merge for trivial checkout
From: Ben Peart @ 2016-09-08 20:44 UTC (permalink / raw)
To: git; +Cc: gitster, pclouds, =peartben, Ben Peart
Teach git to avoid unnecessary merge during trivial checkout. When
running 'git checkout -b foo' git follows a common code path through
the expensive merge_working_tree even when it is unnecessary. As a
result, 95% of the time is spent in merge_working_tree doing the 2-way
merge between the new and old commit trees that is unneeded.
The time breakdown is as follows:
merge_working_tree <-- 95%
unpack_trees <-- 80%
traverse_trees <-- 50%
cache_tree_update <-- 17%
mark_new_skip_worktree <-- 10%
With a large repo, this cost is pronounced. Using "git checkout -b r"
to create and switch to a new branch costs 166 seconds (all times worst
case with a cold file system cache).
git.c:406 trace: built-in: git 'checkout' '-b' 'r'
read-cache.c:1667 performance: 17.442926555 s: read_index_from
name-hash.c:128 performance: 2.912145231 s: lazy_init_name_hash
read-cache.c:2208 performance: 4.387713335 s: write_locked_index
trace.c:420 performance: 166.458921289 s: git command:
'c:\Users\benpeart\bin\git.exe' 'checkout' '-b' 'r'
Switched to a new branch 'r'
By adding a test to skip the unnecessary call to merge_working_tree in
this case reduces the cost to 16 seconds.
git.c:406 trace: built-in: git 'checkout' '-b' 's'
read-cache.c:1667 performance: 16.100742476 s: read_index_from
trace.c:420 performance: 16.461547867 s: git command: 'c:\Users\benpeart\bin\git.exe' 'checkout' '-b' 's'
Switched to a new branch 's'
Signed-off-by: Ben Peart <benpeart@microsoft.com>
---
builtin/checkout.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 8672d07..595d64b 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -827,10 +827,25 @@ static int switch_branches(const struct checkout_opts *opts,
parse_commit_or_die(new->commit);
}
- ret = merge_working_tree(opts, &old, new, &writeout_error);
- if (ret) {
- free(path_to_free);
- return ret;
+ /*
+ * Optimize the performance of checkout when the current and
+ * new branch have the same OID and avoid the trivial merge.
+ * For example, a "git checkout -b foo" just needs to create
+ * the new ref and report the stats.
+ */
+ if (!old.commit || !new->commit
+ || oidcmp(&old.commit->object.oid, &new->commit->object.oid)
+ || !opts->new_branch || opts->new_branch_force || opts->new_orphan_branch
+ || opts->patch_mode || opts->merge || opts->force || opts->force_detach
+ || opts->writeout_stage || !opts->overwrite_ignore
+ || opts->ignore_skipworktree || opts->ignore_other_worktrees
+ || opts->new_branch_log || opts->branch_exists || opts->prefix
+ || opts->source_tree) {
+ ret = merge_working_tree(opts, &old, new, &writeout_error);
+ if (ret) {
+ free(path_to_free);
+ return ret;
+ }
}
if (!opts->quiet && !old.path && old.commit && new->commit != old.commit)
--
2.10.0.windows.1
^ permalink raw reply related
* Re: [PATCH 01/13] i18n: apply: mark plural string for translation
From: Junio C Hamano @ 2016-09-08 20:45 UTC (permalink / raw)
To: Vasco Almeida; +Cc: git, Jiang Xin, Ævar Arnfjörð Bjarmason
In-Reply-To: <1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt>
Thanks.
I'll skip 01-03/13 and queue the remainder for now, as I'd want to
see Christian's "split builtin/apply.c into two, moving bulk to
apply.c at the top-level to be reused" merged to 'next' sooner and
to 'master' hopefully during this cycle.
^ permalink raw reply
* Re: [PATCH 2/3] diff: omit found pointer from emit_callback
From: Junio C Hamano @ 2016-09-08 20:53 UTC (permalink / raw)
To: Stefan Beller; +Cc: git
In-Reply-To: <20160907233648.5162-4-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
> diff --git a/diff.c b/diff.c
> index 4a6501c..79ad91d 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -354,7 +354,6 @@ struct emit_callback {
> const char **label_path;
> struct diff_words_data *diff_words;
> struct diff_options *opt;
> - int *found_changesp;
> struct strbuf *header;
> };
I briefly wondered if we have some callsites that do not want
o->found_changes to be modified (hence pointing this field at
elsewhere), but the fact that you can _remove_ this field means that
there is no such use case, which is good.
> @@ -722,7 +721,6 @@ static void emit_rewrite_diff(const char *name_a,
>
> memset(&ecbdata, 0, sizeof(ecbdata));
> ecbdata.color_diff = want_color(o->use_color);
> - ecbdata.found_changesp = &o->found_changes;
> ecbdata.ws_rule = whitespace_rule(name_b);
> ecbdata.opt = o;
> if (ecbdata.ws_rule & WS_BLANK_AT_EOF) {
> @@ -1215,13 +1213,13 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
> const char *reset = diff_get_color(ecbdata->color_diff, DIFF_RESET);
> struct diff_options *o = ecbdata->opt;
> const char *line_prefix = diff_line_prefix(o);
> + o->found_changes = 1;
>
> if (ecbdata->header) {
> fprintf(o->file, "%s", ecbdata->header->buf);
> strbuf_reset(ecbdata->header);
> ecbdata->header = NULL;
> }
> - *(ecbdata->found_changesp) = 1;
Is there a good reason to move the assignment up? "The fact that
this function was called even once means we found some change" is
probably a good argument, but then I'd prefer to have a blank before
it to separate it (the first statement) from the block of decls.
No need to resend. Thanks.
^ permalink raw reply
* Re: [PATCH 3/3] diff: remove dead code
From: Junio C Hamano @ 2016-09-08 21:07 UTC (permalink / raw)
To: Stefan Beller; +Cc: git
In-Reply-To: <20160907233648.5162-6-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
> When `len < 1`, len has to be 0 or negative, emit_line will then remove the
> first character and by then `len` would be negative. As this doesn't
> happen, it is safe to assume it is dead code.
>
> This continues to simplify the code, which was started in b8d9c1a66b
> (2009-09-03, diff.c: the builtin_diff() deals with only two-file
> comparison).
We look at line[0] to see if it is '@' before this check, which
would have been wrong if "len < 1" were ever true.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
> diff.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/diff.c b/diff.c
> index 79ad91d..c143019 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -1251,14 +1251,6 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
> return;
> }
>
> - if (len < 1) {
> - emit_line(o, reset, reset, line, len);
> - if (ecbdata->diff_words
> - && ecbdata->diff_words->type == DIFF_WORDS_PORCELAIN)
> - fputs("~\n", o->file);
> - return;
> - }
> -
> if (ecbdata->diff_words) {
> if (line[0] == '-') {
> diff_words_append(line, len,
^ permalink raw reply
* Re: [PATCH v7 03/10] pkt-line: add packet_write_fmt_gently()
From: Stefan Beller @ 2016-09-08 21:18 UTC (permalink / raw)
To: Lars Schneider
Cc: git@vger.kernel.org, Jeff King, Junio C Hamano,
Johannes Schindelin, Jakub Narębski, Martin-Louis Bright,
Torsten Bögershausen, Jacob Keller
In-Reply-To: <20160908182132.50788-4-larsxschneider@gmail.com>
On Thu, Sep 8, 2016 at 11:21 AM, <larsxschneider@gmail.com> wrote:
> +static int packet_write_fmt_1(int fd, int gently,
> + const char *fmt, va_list args)
> +{
> + struct strbuf buf = STRBUF_INIT;
> + size_t count;
> +
> + format_packet(&buf, fmt, args);
> + count = write_in_full(fd, buf.buf, buf.len);
> + if (count == buf.len)
> + return 0;
> +
> + if (!gently) {
call check_pipe from write_or_die here instead of
reproducing that function?
> + if (errno == EPIPE) {
> + if (in_async())
> + async_exit(141);
> +
> + signal(SIGPIPE, SIG_DFL);
> + raise(SIGPIPE);
> + /* Should never happen, but just in case... */
> + exit(141);
> + }
> + die_errno("packet write error");
> + }
> + error("packet write failed");
> + return -1;
I think the more idiomatic way is to
return error(...);
as error always return -1.
^ permalink raw reply
* Re: [PATCH] checkout: eliminate unnecessary merge for trivial checkout
From: Junio C Hamano @ 2016-09-08 21:22 UTC (permalink / raw)
To: Ben Peart; +Cc: git, pclouds, =peartben, Ben Peart
In-Reply-To: <20160908204431.14612-1-benpeart@microsoft.com>
Ben Peart <peartben@gmail.com> writes:
> Teach git to avoid unnecessary merge during trivial checkout. When
> running 'git checkout -b foo' git follows a common code path through
> the expensive merge_working_tree even when it is unnecessary.
I would be lying if I said I am not sympathetic to the cause, but...
> + /*
> + * Optimize the performance of checkout when the current and
> + * new branch have the same OID and avoid the trivial merge.
> + * For example, a "git checkout -b foo" just needs to create
> + * the new ref and report the stats.
> + */
> + if (!old.commit || !new->commit
> + || oidcmp(&old.commit->object.oid, &new->commit->object.oid)
> + || !opts->new_branch || opts->new_branch_force || opts->new_orphan_branch
> + || opts->patch_mode || opts->merge || opts->force || opts->force_detach
> + || opts->writeout_stage || !opts->overwrite_ignore
> + || opts->ignore_skipworktree || opts->ignore_other_worktrees
> + || opts->new_branch_log || opts->branch_exists || opts->prefix
> + || opts->source_tree) {
... this is a maintenance nightmare in that any new option we will
add later will need to consider what this "optimization" is trying
(not) to skip. The first two lines (i.e. we need a real checkout if
we cannot positively say that old and new commits are the same
object) are clear, but no explanation was given for all the other
random conditions this if condition checks. What if opts->something
was not listed (or "listed" for that matter) in the list above--it
is totally unclear if it was missed by mistake (or "added by
mistake") or deliberately excluded (or "deliberately added").
For example, why is opts->prefix there? If
git checkout -b new-branch HEAD
should be able to omit the two-way merge, shouldn't
cd t && git checkout -b new-branch HEAD
also be able to?
Even the main condition is unclear. It wants to see that old and
new have exactly the same commit, but shouldn't the "the result of
the two-way merge is known to be no-op" logic equally apply if the
old and two trees are the same?
^ permalink raw reply
* Re: [PATCH v7 05/10] pkt-line: add packet_write_gently()
From: Stefan Beller @ 2016-09-08 21:24 UTC (permalink / raw)
To: Lars Schneider
Cc: git@vger.kernel.org, Jeff King, Junio C Hamano,
Johannes Schindelin, Jakub Narębski, Martin-Louis Bright,
Torsten Bögershausen, Jacob Keller
In-Reply-To: <20160908182132.50788-6-larsxschneider@gmail.com>
On Thu, Sep 8, 2016 at 11:21 AM, <larsxschneider@gmail.com> wrote:
> From: Lars Schneider <larsxschneider@gmail.com>
>
> packet_write_fmt_gently() uses format_packet() which lets the caller
> only send string data via "%s". That means it cannot be used for
> arbitrary data that may contain NULs.
Makes sense.
>
> Add packet_write_gently() which writes arbitrary data and returns `0`
> for success and `-1` for an error.
I think documenting the return code is better done in either the header file
or in a commend preceding the implementation instead of the commit message?
Maybe just a generic comment for *_gently is good enough, maybe even no
comment. So the commit is fine, too. I dunno.
> This function is used by other
> pkt-line functions in a subsequent patch.
That's what I figured. Do we also need to mention that in the preceding patch
for packet_flush_gently ?
>
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
> ---
> pkt-line.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/pkt-line.c b/pkt-line.c
> index 37345ca..1d3d725 100644
> --- a/pkt-line.c
> +++ b/pkt-line.c
> @@ -181,6 +181,25 @@ int packet_write_fmt_gently(int fd, const char *fmt, ...)
> return status;
> }
>
> +int packet_write_gently(const int fd_out, const char *buf, size_t size)
> +{
> + static char packet_write_buffer[LARGE_PACKET_MAX];
> +
> + if (size > sizeof(packet_write_buffer) - 4) {
> + error("packet write failed");
> + return -1;
> + }
> + packet_trace(buf, size, 1);
> + size += 4;
> + set_packet_header(packet_write_buffer, size);
> + memcpy(packet_write_buffer + 4, buf, size - 4);
> + if (write_in_full(fd_out, packet_write_buffer, size) == size)
> + return 0;
> +
> + error("packet write failed");
> + return -1;
> +}
> +
> void packet_buf_write(struct strbuf *buf, const char *fmt, ...)
> {
> va_list args;
> --
> 2.10.0
>
^ permalink raw reply
* Re: [PATCH] Move format-patch base commit and prerequisites before email signature
From: Junio C Hamano @ 2016-09-08 21:24 UTC (permalink / raw)
To: Jeff King; +Cc: Josh Triplett, git
In-Reply-To: <20160908200819.pkg7jqcvxjpdqr3a@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> On Thu, Sep 08, 2016 at 11:54:08AM -0700, Josh Triplett wrote:
>
>> > your problem description
>> > looks perfect. I am still not sure if the code does a reasonable
>> > thing in MIME case, though.
>>
>> It *looks* correct to me.
>
> Hmm. It looks correct to me, too; ...
> ...
> So this is actually fixing a bug,...
Yes, I actually wanted to hear that from Josh and have that in the
proposed log message ;-).
^ permalink raw reply
* Re: [PATCH v2 3/3] Use the newly-introduced regexec_buf() function
From: Junio C Hamano @ 2016-09-08 21:30 UTC (permalink / raw)
To: Jeff King; +Cc: Ramsay Jones, Johannes Schindelin, git
In-Reply-To: <20160908195300.votzp3ysxewc2mip@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
>> commit f96e5673 ("grep: use REG_STARTEND for all matching if available",
>> 22-05-2010) introduced this test and expects ".. NUL characters themselves
>> are not matched in any way". With the native library on cygwin they are
>> matched, with the compat/regex they are not. Indeed, if you use the system
>> 'grep' command (rather than 'git grep'), then it will also not match ... :-D
>>
>> Slightly off topic, but ...
>
> Hmm. So it sounds like the "regmatch" in grep.c could go away in favor
> of Johannes's regexec_buf(), and cygwin ought to be using NO_REGEX.
Sounds like a plan.
^ permalink raw reply
* Re: [PATCH 4/5] versioncmp: pass full tagnames to swap_prereleases()
From: Junio C Hamano @ 2016-09-08 21:31 UTC (permalink / raw)
To: SZEDER Gábor
Cc: Jeff King, Leho Kraav, Nguyễn Thái Ngọc Duy, git
In-Reply-To: <20160908223727.Horde.jVOOJ278ssZ3qkyjkmyqZD-@webmail.informatik.kit.edu>
SZEDER Gábor <szeder@ira.uka.de> writes:
> I'm not sure about the relevancy of this pararaph, or the relevancy of
> the original version for that matter. I mean, there is a different
> character for sure, so it's really rather obvious that it can't
> possibly be the same suffix in both, isn't it? So I don't think it
> adds much value, and don't mind deleting it in the reroll.
Concurred. Let's lose this confusing statement.
Thanks.
^ permalink raw reply
* Re: [PATCH] gpg-interface: reflect stderr to stderr
From: Junio C Hamano @ 2016-09-08 21:36 UTC (permalink / raw)
To: Jeff King; +Cc: Michael J Gruber, Johannes Schindelin, git
In-Reply-To: <20160908200305.okeeh35xmrvcveyg@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
>> Even though this patch is fixing only one of the two issues, I am
>> tempted to say that we should queue it for now, as it does so
>> without breaking a bigger gain made by the original, i.e. we learn
>> the status of verification in a way the authors of GPG wants us to,
>> while somebody figuires out what the best way is to show the prompt
>> to the console on Windows.
>
> That's OK by me, but I don't know if we can put off the "best way to
> show the prompt" fix. It seems like a pretty serious regression for
> people on Windows.
Yes, I am not saying that it is OK to keep Windows users broken.
As I understand what Dscho said correctly, his users are covered by
a reversion of the "read the GPG status correctly" patch, i.e. with
a different trade-off between the correctness of GPG status vs
usability of the prompt, he will ship with Git for Windows, and that
stop-gap measure will last only until developers who can do Windows
(which excludes you, me, and Michael it seems) comes up with a
solution that satisfies both.
I consider that an approach that is perfectly fine.
^ permalink raw reply
* Re: [PATCH] checkout: eliminate unnecessary merge for trivial checkout
From: Jeff King @ 2016-09-08 21:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Ben Peart, git, pclouds, =peartben, Ben Peart
In-Reply-To: <xmqqh99qf5o7.fsf@gitster.mtv.corp.google.com>
On Thu, Sep 08, 2016 at 02:22:16PM -0700, Junio C Hamano wrote:
> > + /*
> > + * Optimize the performance of checkout when the current and
> > + * new branch have the same OID and avoid the trivial merge.
> > + * For example, a "git checkout -b foo" just needs to create
> > + * the new ref and report the stats.
> > + */
> > + if (!old.commit || !new->commit
> > + || oidcmp(&old.commit->object.oid, &new->commit->object.oid)
> > + || !opts->new_branch || opts->new_branch_force || opts->new_orphan_branch
> > + || opts->patch_mode || opts->merge || opts->force || opts->force_detach
> > + || opts->writeout_stage || !opts->overwrite_ignore
> > + || opts->ignore_skipworktree || opts->ignore_other_worktrees
> > + || opts->new_branch_log || opts->branch_exists || opts->prefix
> > + || opts->source_tree) {
>
> ... this is a maintenance nightmare in that any new option we will
> add later will need to consider what this "optimization" is trying
> (not) to skip. The first two lines (i.e. we need a real checkout if
> we cannot positively say that old and new commits are the same
> object) are clear, but no explanation was given for all the other
> random conditions this if condition checks. What if opts->something
> was not listed (or "listed" for that matter) in the list above--it
> is totally unclear if it was missed by mistake (or "added by
> mistake") or deliberately excluded (or "deliberately added").
>
> For example, why is opts->prefix there? If
>
> git checkout -b new-branch HEAD
>
> should be able to omit the two-way merge, shouldn't
>
> cd t && git checkout -b new-branch HEAD
>
> also be able to?
I was just writing another reply, but I think our complaints may have
dovetailed.
My issue is that the condition above is an unreadable mass. It would be
really nice to pull it out into a helper function, and then all of the
items could be split out and commented independently, like:
static int needs_working_tree_merge(const struct checkout_opts *opts,
const struct branch_info *old,
const struct branch_info *new)
{
/*
* We must do the merge if we are actually moving to a new
* commit.
*/
if (!old->commit || !new->commit ||
oidcmp(&old.commit->object.oid, &new->commit->object.oid))
return 1;
/* Option "foo" is not compatible because of... */
if (opts->foo)
return 1;
... etc ...
}
That still leaves your "what if opts->something is not listed" question
open, but at least it makes it easier to comment on it in the code.
-Peff
PS I didn't think hard on whether the conditions above make _sense_. My
first goal would be to get more communication about them individually,
and then we can evaluate them.
^ permalink raw reply
* Bug: git-p4 can generate duplicate commits when syncing changes that span multiple depot paths
From: James Farwell @ 2016-09-08 21:41 UTC (permalink / raw)
To: git@vger.kernel.org
Reproduction Steps:
1. Have a git repo cloned from a perforce repo using multiple depot paths (e.g. //depot/foo and //depot/bar).
2. Submit a single change to the perforce repo that makes changes in both //depot/foo and //depot/bar.
3. Run "git p4 sync" to sync the change from #2.
Expected Behavior:
Change should be synced as a single commit to the git repo.
Actual Behavior:
Change is synced as multiple commits, one for each depot path that was affected.
Best Guess:
I believe this is happening because the command syntax "p4 changes //depot/foo/...@123,456 //depot/bar/...@123,456", which git-p4 uses to get the list of changes to sync, will return the same change number multiple times if the change was present in multiple depot paths. This is expected behavior as per the p4 changes documentation: "If p4 changes is called with multiple file arguments, the sets of changelists that affect each argument are evaluated individually. The final output is neither combined nor sorted; the effect is the same as calling p4 changes multiple times, once for each file argument." git-p4 is handling the sorting itself, but it is not handling the combining.
I would imagine this is fixable in the p4ChangesForPaths() method by dropping non-unique elements of the list before or after sorting. Rudimentary testing in the python interpreter would suggest that something like "changes = sorted(set(changes))" should do the trick, but I am no python expert so there may be a better way.
Thanks!
- James
^ permalink raw reply
* Re: [PATCH v2 38/38] refs: implement iteration over only per-worktree refs
From: David Turner @ 2016-09-08 21:45 UTC (permalink / raw)
To: Michael Haggerty
Cc: Junio C Hamano, Ramsay Jones, Eric Sunshine, Jeff King,
Nguyễn Thái Ngọc Duy, git, David Turner
In-Reply-To: <d4e799241de9186f05187d820707c103bc5b4e8e.1473003903.git.mhagger@alum.mit.edu>
Other than the duplicated sign-offs, this series looks good to me
("Don't act surprised, you guys, cuz I wrote 'em").
Kind of a funny place to cut it off, but I guess it makes sense.
On Sun, 2016-09-04 at 18:08 +0200, Michael Haggerty wrote:
> From: David Turner <dturner@twopensource.com>
>
> Alternate refs backends might still use files to store per-worktree
> refs. So provide a way to iterate over only the per-worktree references
> in a ref_store. The other backend can set up a files ref_store and
> iterate using the new DO_FOR_EACH_PER_WORKTREE_ONLY flag when iterating.
^ permalink raw reply
* Re: [PATCH v7 06/10] pkt-line: add functions to read/write flush terminated packet streams
From: Stefan Beller @ 2016-09-08 21:49 UTC (permalink / raw)
To: Lars Schneider
Cc: git@vger.kernel.org, Jeff King, Junio C Hamano,
Johannes Schindelin, Jakub Narębski, Martin-Louis Bright,
Torsten Bögershausen, Jacob Keller
In-Reply-To: <20160908182132.50788-7-larsxschneider@gmail.com>
On Thu, Sep 8, 2016 at 11:21 AM, <larsxschneider@gmail.com> wrote:
> From: Lars Schneider <larsxschneider@gmail.com>
>
> write_packetized_from_fd() and write_packetized_from_buf() write a
> stream of packets. All content packets use the maximal packet size
> except for the last one. After the last content packet a `flush` control
> packet is written.
I presume we need both write_* things in a later patch; can you clarify why
we need both of them?
> + if (paket_len < 0) {
> + if (oldalloc == 0)
> + strbuf_release(sb_out);
So if old alloc is 0, we release it, which is documented as
/**
* Release a string buffer and the memory it used. You should not use the
* string buffer after using this function, unless you initialize it again.
*/
> + else
> + strbuf_setlen(sb_out, oldlen);
Otherwise we just set the length back, such that it looks like before.
So as a caller the strbuf is in a different state in case of error
depending whether
the strbuf already had some data in it. I think it would be better if
we only did
`strbuf_setlen(sb_out, oldlen);` here, such that the caller can
strbuf_release it
unconditionally.
Or to make things more confusing, you could use strbuf_reset in case of 0,
as that is a strbuf_setlen internally. ;)
> @@ -77,6 +79,11 @@ char *packet_read_line(int fd, int *size);
> */
> char *packet_read_line_buf(char **src_buf, size_t *src_len, int *size);
>
> +/*
> + * Reads a stream of variable sized packets until a flush packet is detected.
Strictly speaking we read until a packet of size 0 appears, but as per
the implementation
of packet_read we cannot distinguish between "0000" and "0004", i.e.
an empty non-flush
packet. So I think we're fine both in the implementation as well as
the documentation here.
^ permalink raw reply
* Re: [PATCH v7 08/10] convert: modernize tests
From: Stefan Beller @ 2016-09-08 22:05 UTC (permalink / raw)
To: Lars Schneider
Cc: git@vger.kernel.org, Jeff King, Junio C Hamano,
Johannes Schindelin, Jakub Narębski, Martin-Louis Bright,
Torsten Bögershausen, Jacob Keller
In-Reply-To: <20160908182132.50788-9-larsxschneider@gmail.com>
On Thu, Sep 8, 2016 at 11:21 AM, <larsxschneider@gmail.com> wrote:
> From: Lars Schneider <larsxschneider@gmail.com>
>
> Use `test_config` to set the config, check that files are empty with
> `test_must_be_empty`, compare files with `test_cmp`, and remove spaces
> after ">" and "<".
>
> Please note that the "rot13" filter configured in "setup" keeps using
> `git config` instead of `test_config` because subsequent tests might
> depend on it.
>
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
> ---
Makes sense & Reviewed-by "Stefan Beller <sbeller@google.com>"
Thanks,
Stefan
^ permalink raw reply
* What's cooking in git.git (Sep 2016, #02; Thu, 8)
From: Junio C Hamano @ 2016-09-08 22:22 UTC (permalink / raw)
To: git
Here are the topics that have been cooking. Commits prefixed with
'-' are only in 'pu' (proposed updates) while commits prefixed with
'+' are in 'next'. The ones marked with '.' do not appear in any of
the integration branches, but I am still holding onto them.
There are a few more topics in flight that may be ready to be picked
up but I haven't, and other topics in flight that may not be quite
ready. I'll start merging topics that have been cooking in 'next'
to 'master', rewind and rebuild 'next', and merge those that have
been waiting in 'pu' to 'next' before picking them up.
You can find the changes described here in the integration branches
of the repositories listed at
http://git-blame.blogspot.com/p/git-public-repositories.html
--------------------------------------------------
[New Topics]
* bc/object-id (2016-09-07) 20 commits
- builtin/reset: convert to use struct object_id
- builtin/commit-tree: convert to struct object_id
- builtin/am: convert to struct object_id
- refs: add an update_ref_oid function.
- sha1_name: convert get_sha1_mb to struct object_id
- builtin/update-index: convert file to struct object_id
- notes: convert init_notes to use struct object_id
- builtin/rm: convert to use struct object_id
- builtin/blame: convert file to use struct object_id
- Convert read_mmblob to take struct object_id.
- notes-merge: convert struct notes_merge_pair to struct object_id
- builtin/checkout: convert some static functions to struct object_id
- streaming: make stream_blob_to_fd take struct object_id
- builtin: convert textconv_object to use struct object_id
- builtin/cat-file: convert some static functions to struct object_id
- builtin/cat-file: convert struct expand_data to use struct object_id
- builtin/log: convert some static functions to use struct object_id
- builtin/blame: convert struct origin to use struct object_id
- builtin/apply: convert static functions to struct object_id
- cache: convert struct cache_entry to use struct object_id
The "unsigned char sha1[20]" to "struct object_id" conversion
continues. Notable changes in this round includes that ce->sha1,
i.e. the object name recorded in the cache_entry, turns into an
object_id.
It had merge conflicts with a few topics in flight (Christian's
"apply.c split", Dscho's "cat-file --filters" and Jeff Hostetler's
"status --porcelain-v2"). Extra sets of eyes double-checking for
mismerges are highly appreciated.
* ep/use-git-trace-curl-in-tests (2016-09-07) 4 commits
- t5551-http-fetch-smart.sh: use the GIT_TRACE_CURL environment var
- t5550-http-fetch-dumb.sh: use the GIT_TRACE_CURL environment var
- test-lib.sh: preserve GIT_TRACE_CURL from the environment
- t5541-http-push-smart.sh: use the GIT_TRACE_CURL environment var
Update a few tests that used to use GIT_CURL_VERBOSE to use the
newer GIT_TRACE_CURL.
Will merge to 'next'.
* jk/pack-tag-of-tag (2016-09-07) 5 commits
- pack-objects: walk tag chains for --include-tag
- t5305: simplify packname handling
- t5305: use "git -C"
- t5305: drop "dry-run" of unpack-objects
- t5305: move cleanup into test block
"git pack-objects --include-tag" was taught that when we know that
we are sending an object C, we want a tag B that directly points at
C but also a tag A that points at the tag B. We used to miss the
intermediate tag B in some cases.
* js/t6026-clean-up (2016-09-07) 1 commit
- t6026-merge-attr: clean up background process at end of test case
A test spawned a short-lived background process, which sometimes
prevented the test directory from getting removed at the end of the
script on some platforms.
Will merge to 'next'.
* js/t9903-chaining (2016-09-07) 1 commit
- t9903: fix broken && chain
Will merge to 'next'.
* jt/accept-capability-advertisement-when-fetching-from-void (2016-09-07) 2 commits
- connect: advertized capability is not a ref
- tests: move test_lazy_prereq JGIT to test-lib.sh
JGit can show a fake ref "capabilities^{}" to "git fetch" when it
does not advertise any refs, but "git fetch" was not prepared to
see such an advertisement.
Waiting for a reroll.
Rewording the log, and avoiding making it overly loose are needed.
cf. <20160908013431.GC25016@google.com>
* rs/compat-strdup (2016-09-07) 1 commit
- compat: move strdup(3) replacement to its own file
Will merge to 'next'.
* rs/hex2chr (2016-09-07) 1 commit
- introduce hex2chr() for converting two hexadecimal digits to a character
Will merge to 'next'.
* rt/rebase-i-broken-insn-advise (2016-09-07) 1 commit
- rebase -i: improve advice on bad instruction lines
When "git rebase -i" is given a broken instruction, it told the
user to fix it with "--edit-todo", but didn't say what the step
after that was (i.e. "--continue").
Will hold.
Dscho's "rebase -i" hopefully will become available in 'pu', by
which time an equivalent of this fix would be ported to C. This is
queued merely as a reminder.
* sb/xdiff-remove-unused-static-decl (2016-09-07) 1 commit
- xdiff: remove unneeded declarations
Code cleanup.
Will merge to 'next'.
* sy/git-gui-i18n-ja (2016-09-07) 7 commits
- Merge branch 'sy/i18n' of git-gui
- git-gui: update Japanese information
- git-gui: update Japanese translation
- git-gui: add Japanese language code
- git-gui: apply po template to Japanese translation
- git-gui: consistently use the same word for "blame" in Japanese
- git-gui: consistently use the same word for "remote" in Japanese
Update Japanese translation for "git-gui".
* ah/misc-message-fixes (2016-09-08) 5 commits
- unpack-trees: do not capitalize "working"
- git-merge-octopus: do not capitalize "octopus"
- git-rebase--interactive: fix English grammar
- cat-file: put spaces around pipes in usage string
- am: put spaces around pipe in usage string
Message cleanup.
Will merge to 'next'.
* jk/fix-remote-curl-url-wo-proto (2016-09-08) 1 commit
- remote-curl: handle URLs without protocol
"git fetch http::/site/path" did not die correctly and segfaulted
instead.
Will merge to 'next'.
* jn/fix-connect-unexpected-hangup-diag (2016-09-08) 1 commit
- connect: tighten check for unexpected early hang up
When the other side disconnects without giving any ref
advertisement, we used to say "there may not be a repository at
that URL", but we may have seen other advertisement like "shallow"
and ".have" in which case we definitely know that a repository is
there. The code to detect this case has been updated.
Waiting for a reroll with test.
cf. <20160908015040.GF25016@google.com>
* jt/format-patch-base-info-above-sig (2016-09-08) 1 commit
- format-patch: show base info before email signature
"git format-patch --base=..." feature that was recently added
showed the base commit information after "-- " e-mail signature
line, which turned out to be inconvenient. The base information
has been moved above the signature line.
Needs rephrasing of the log message to describe an accidental bugfix.
cf. <xmqqd1kef5k5.fsf@gitster.mtv.corp.google.com>
* nd/checkout-disambiguation (2016-09-08) 3 commits
- checkout: fix ambiguity check in subdir
- checkout.txt: document a common case that ignores ambiguation rules
- checkout: add some spaces between code and comment
"git checkout <word>" does not follow the usual disambiguation
rules when the <word> can be both a rev and a path, to allow
checking out a branch 'foo' in a project that happens to have a
file 'foo' in the working tree without having to disambiguate.
This was poorly documented and the check was incorrect when the
command was run from a subdirectory.
Waiting for a reroll.
cf. <xmqq7famgnwo.fsf@gitster.mtv.corp.google.com>
* sb/diff-cleanup (2016-09-08) 3 commits
- diff: remove dead code
- diff: omit found pointer from emit_callback
- diff.c: use diff_options directly
Code cleanup.
Will merge to 'next'.
* sb/transport-report-missing-submodule-on-stderr (2016-09-08) 1 commit
- transport: report missing submodule pushes consistently on stderr
Message cleanup.
Will merge to 'next'.
* sg/fix-versioncmp-with-common-suffix (2016-09-08) 5 commits
- versioncmp: cope with common leading parts in versionsort.prereleaseSuffix
- versioncmp: pass full tagnames to swap_prereleases()
- t7004-tag: add version sort tests to show prerelease reordering issues
- t7004-tag: use test_config helper
- t7004-tag: delete unnecessary tags with test_when_finished
The prereleaseSuffix feature of version comparison that is used in
"git tag -l" did not correctly when two or more prereleases for the
same release were present (e.g. when 2.0, 2.0-beta1, and 2.0-beta2
are there and the code needs to compare 2.0-beta1 and 2.0-beta2).
Waiting for a reroll.
cf. <20160908223727.Horde.jVOOJ278ssZ3qkyjkmyqZD-@webmail.informatik.kit.edu>
* va/i18n (2016-09-08) 10 commits
- i18n: update-index: mark warning for translation
- i18n: show-branch: mark error messages for translation
- i18n: receive-pack: mark messages for translation
- notes: lowercase first word of error messages
- i18n: notes: mark error messages for translation
- i18n: merge-recursive: mark verbose message for translation
- i18n: merge-recursive: mark error messages for translation
- i18n: config: mark error message for translation
- i18n: branch: mark option description for translation
- i18n: blame: mark error messages for translation
More i18n.
Will merge to 'next'.
--------------------------------------------------
[Stalled]
* jc/bundle (2016-03-03) 6 commits
- index-pack: --clone-bundle option
- Merge branch 'jc/index-pack' into jc/bundle
- bundle v3: the beginning
- bundle: keep a copy of bundle file name in the in-core bundle header
- bundle: plug resource leak
- bundle doc: 'verify' is not about verifying the bundle
The beginning of "split bundle", which could be one of the
ingredients to allow "git clone" traffic off of the core server
network to CDN.
While I think it would make it easier for people to experiment and
build on if the topic is merged to 'next', I am at the same time a
bit reluctant to merge an unproven new topic that introduces a new
file format, which we may end up having to support til the end of
time. It is likely that to support a "prime clone from CDN", it
would need a lot more than just "these are the heads and the pack
data is over there", so this may not be sufficient.
Will discard.
* jc/blame-reverse (2016-06-14) 2 commits
- blame: dwim "blame --reverse OLD" as "blame --reverse OLD.."
- blame: improve diagnosis for "--reverse NEW"
It is a common mistake to say "git blame --reverse OLD path",
expecting that the command line is dwimmed as if asking how lines
in path in an old revision OLD have survived up to the current
commit.
Has been waiting for positive responses without seeing any.
Will discard.
* jc/attr (2016-05-25) 18 commits
- attr: support quoting pathname patterns in C style
- attr: expose validity check for attribute names
- attr: add counted string version of git_attr()
- attr: add counted string version of git_check_attr()
- attr: retire git_check_attrs() API
- attr: convert git_check_attrs() callers to use the new API
- attr: convert git_all_attrs() to use "struct git_attr_check"
- attr: (re)introduce git_check_attr() and struct git_attr_check
- attr: rename function and struct related to checking attributes
- attr.c: plug small leak in parse_attr_line()
- attr.c: tighten constness around "git_attr" structure
- attr.c: simplify macroexpand_one()
- attr.c: mark where #if DEBUG ends more clearly
- attr.c: complete a sentence in a comment
- attr.c: explain the lack of attr-name syntax check in parse_attr()
- attr.c: update a stale comment on "struct match_attr"
- attr.c: use strchrnul() to scan for one line
- commit.c: use strchrnul() to scan for one line
(this branch is used by jc/attr-more, sb/pathspec-label and sb/submodule-default-paths.)
The attributes API has been updated so that it can later be
optimized using the knowledge of which attributes are queried.
I wanted to polish this topic further to make the attribute
subsystem thread-ready, but because other topics depend on this
topic and they do not (yet) need it to be thread-ready.
As the authors of topics that depend on this seem not in a hurry,
let's discard this and dependent topics and restart them some other
day.
Will discard.
* jc/attr-more (2016-06-09) 8 commits
- attr.c: outline the future plans by heavily commenting
- attr.c: always pass check[] to collect_some_attrs()
- attr.c: introduce empty_attr_check_elems()
- attr.c: correct ugly hack for git_all_attrs()
- attr.c: rename a local variable check
- fixup! d5ad6c13
- attr.c: pass struct git_attr_check down the callchain
- attr.c: add push_stack() helper
(this branch uses jc/attr; is tangled with sb/pathspec-label and sb/submodule-default-paths.)
The beginning of long and tortuous journey to clean-up attribute
subsystem implementation.
Needs to be redone.
Will discard.
* sb/submodule-default-paths (2016-06-20) 5 commits
- completion: clone can recurse into submodules
- clone: add --init-submodule=<pathspec> switch
- submodule update: add `--init-default-path` switch
- Merge branch 'sb/pathspec-label' into sb/submodule-default-paths
- Merge branch 'jc/attr' into sb/submodule-default-paths
(this branch uses jc/attr and sb/pathspec-label; is tangled with jc/attr-more.)
Allow specifying the set of submodules the user is interested in on
the command line of "git clone" that clones the superproject.
Will discard.
* sb/pathspec-label (2016-06-03) 6 commits
- pathspec: disable preload-index when attribute pathspec magic is in use
- pathspec: allow escaped query values
- pathspec: allow querying for attributes
- pathspec: move prefix check out of the inner loop
- pathspec: move long magic parsing out of prefix_pathspec
- Documentation: fix a typo
(this branch is used by sb/submodule-default-paths; uses jc/attr; is tangled with jc/attr-more.)
The pathspec mechanism learned ":(attr:X)$pattern" pathspec magic
to limit paths that match $pattern further by attribute settings.
The preload-index mechanism is disabled when the new pathspec magic
is in use (at least for now), because the attribute subsystem is
not thread-ready.
Will discard.
* mh/connect (2016-06-06) 10 commits
- connect: [host:port] is legacy for ssh
- connect: move ssh command line preparation to a separate function
- connect: actively reject git:// urls with a user part
- connect: change the --diag-url output to separate user and host
- connect: make parse_connect_url() return the user part of the url as a separate value
- connect: group CONNECT_DIAG_URL handling code
- connect: make parse_connect_url() return separated host and port
- connect: re-derive a host:port string from the separate host and port variables
- connect: call get_host_and_port() earlier
- connect: document why we sometimes call get_port after get_host_and_port
Rewrite Git-URL parsing routine (hopefully) without changing any
behaviour.
It has been two months without any support. We may want to discard
this.
* sb/bisect (2016-04-15) 22 commits
. SQUASH???
. bisect: get back halfway shortcut
. bisect: compute best bisection in compute_relevant_weights()
. bisect: use a bottom-up traversal to find relevant weights
. bisect: prepare for different algorithms based on find_all
. bisect: rename count_distance() to compute_weight()
. bisect: make total number of commits global
. bisect: introduce distance_direction()
. bisect: extract get_distance() function from code duplication
. bisect: use commit instead of commit list as arguments when appropriate
. bisect: replace clear_distance() by unique markers
. bisect: use struct node_data array instead of int array
. bisect: get rid of recursion in count_distance()
. bisect: make algorithm behavior independent of DEBUG_BISECT
. bisect: make bisect compile if DEBUG_BISECT is set
. bisect: plug the biggest memory leak
. bisect: add test for the bisect algorithm
. t6030: generalize test to not rely on current implementation
. t: use test_cmp_rev() where appropriate
. t/test-lib-functions.sh: generalize test_cmp_rev
. bisect: allow 'bisect run' if no good commit is known
. bisect: write about `bisect next` in documentation
The internal algorithm used in "git bisect" to find the next commit
to check has been optimized greatly.
Was expecting a reroll, but now pb/bisect topic starts removinging
more and more parts from git-bisect.sh, this needs to see a fresh
reroll.
Will discard.
cf. <1460294354-7031-1-git-send-email-s-beyer@gmx.net>
* sg/completion-updates (2016-02-28) 21 commits
. completion: cache the path to the repository
. completion: extract repository discovery from __gitdir()
. completion: don't guard git executions with __gitdir()
. completion: consolidate silencing errors from git commands
. completion: don't use __gitdir() for git commands
. completion: respect 'git -C <path>'
. completion: fix completion after 'git -C <path>'
. completion: don't offer commands when 'git --opt' needs an argument
. rev-parse: add '--absolute-git-dir' option
. completion: list short refs from a remote given as a URL
. completion: don't list 'HEAD' when trying refs completion outside of a repo
. completion: list refs from remote when remote's name matches a directory
. completion: respect 'git --git-dir=<path>' when listing remote refs
. completion: fix most spots not respecting 'git --git-dir=<path>'
. completion: ensure that the repository path given on the command line exists
. completion tests: add tests for the __git_refs() helper function
. completion tests: check __gitdir()'s output in the error cases
. completion tests: consolidate getting path of current working directory
. completion tests: make the $cur variable local to the test helper functions
. completion tests: don't add test cruft to the test repository
. completion: improve __git_refs()'s in-code documentation
Has been waiting for a reroll for too long.
cf. <1456754714-25237-1-git-send-email-szeder@ira.uka.de>
Will discard.
* ec/annotate-deleted (2015-11-20) 1 commit
- annotate: skip checking working tree if a revision is provided
Usability fix for annotate-specific "<file> <rev>" syntax with deleted
files.
Has been waiting for a review for too long without seeing anything.
Will discard.
* dk/gc-more-wo-pack (2016-01-13) 4 commits
- gc: clean garbage .bitmap files from pack dir
- t5304: ensure non-garbage files are not deleted
- t5304: test .bitmap garbage files
- prepare_packed_git(): find more garbage
Follow-on to dk/gc-idx-wo-pack topic, to clean up stale
.bitmap and .keep files.
Has been waiting for a reroll for too long.
cf. <xmqq60ypbeng.fsf@gitster.mtv.corp.google.com>
Will discard.
* jc/diff-b-m (2015-02-23) 5 commits
. WIPWIP
. WIP: diff-b-m
- diffcore-rename: allow easier debugging
- diffcore-rename.c: add locate_rename_src()
- diffcore-break: allow debugging
"git diff -B -M" produced incorrect patch when the postimage of a
completely rewritten file is similar to the preimage of a removed
file; such a resulting file must not be expressed as a rename from
other place.
The fix in this patch is broken, unfortunately.
Will discard.
--------------------------------------------------
[Cooking]
* jc/submodule-anchor-git-dir (2016-09-01) 1 commit
- submodule: avoid auto-discovery in prepare_submodule_repo_env()
Having a submodule whose ".git" repository is somehow corrupt
caused a few commands that recurse into submodules loop forever.
Will merge to 'next'.
* jc/forbid-symbolic-ref-d-HEAD (2016-09-02) 1 commit
- symbolic-ref -d: do not allow removal of HEAD
"git symbolic-ref -d HEAD" happily removes the symbolic ref, but
the resulting repository becomes an invalid one. Teach the command
to forbid removal of HEAD.
Will merge to 'next'.
* bh/diff-highlight-graph (2016-08-31) 6 commits
(merged to 'next' on 2016-08-31 at 523a15f)
+ diff-highlight: avoid highlighting combined diffs
+ diff-highlight: add multi-byte tests
+ diff-highlight: ignore test cruft
+ diff-highlight: add support for --graph output
+ diff-highlight: add failing test for handling --graph output
+ diff-highlight: add some tests
"diff-highlight" script (in contrib/) learned to work better with
"git log -p --graph" output.
Will merge to 'master'.
* jc/am-read-author-file (2016-08-30) 1 commit
- am: refactor read_author_script()
Extract a small helper out of the function that reads the authors
script file "git am" internally uses.
Will merge to 'next'.
This by itself is not useful until a second caller appears in the
future for "rebase -i" helper.
* jk/test-lib-drop-pid-from-results (2016-08-30) 1 commit
- test-lib: drop PID from test-results/*.count
The test framework left the number of tests and success/failure
count in the t/test-results directory, keyed by the name of the
test script plus the process ID. The latter however turned out not
to serve any useful purpose. The process ID part of the filename
has been removed.
Will merge to 'next'.
* js/sequencer-wo-die (2016-08-29) 14 commits
- sequencer: lib'ify save_opts()
- sequencer: lib'ify save_todo()
- sequencer: lib'ify save_head()
- sequencer: lib'ify create_seq_dir()
- sequencer: lib'ify read_populate_opts()
- sequencer: lib'ify read_populate_todo()
- sequencer: lib'ify read_and_refresh_cache()
- sequencer: lib'ify prepare_revs()
- sequencer: lib'ify walk_revs_populate_todo()
- sequencer: lib'ify do_pick_commit()
- sequencer: lib'ify do_recursive_merge()
- sequencer: lib'ify write_message()
- sequencer: do not die() in do_pick_commit()
- sequencer: lib'ify sequencer_pick_revisions()
Lifts calls to exit(2) and die() higher in the callchain in
sequencer.c files so that more helper functions in it can be used
by callers that want to handle error conditions themselves.
Waiting for a reroll.
* jk/squelch-false-warning-from-gcc-o3 (2016-08-31) 2 commits
- color_parse_mem: initialize "struct color" temporary
- error_errno: use constant return similar to error()
Will merge to 'next'.
* hv/doc-commit-reference-style (2016-08-26) 1 commit
(merged to 'next' on 2016-08-31 at 68fb778)
+ SubmittingPatches: use gitk's "Copy commit summary" format
A small doc update.
Will merge to 'master'.
* cc/receive-pack-limit (2016-08-24) 3 commits
(merged to 'next' on 2016-08-25 at bc74b5b)
+ receive-pack: allow a maximum input size to be specified
+ unpack-objects: add --max-input-size=<size> option
+ index-pack: add --max-input-size=<size> option
An incoming "git push" that attempts to push too many bytes can now
be rejected by setting a new configuration variable at the receiving
end.
Will merge to 'master'.
* jk/format-patch-number-singleton-patch-with-cover (2016-08-23) 1 commit
(merged to 'next' on 2016-08-25 at a4737fb)
+ format-patch: show 0/1 and 1/1 for singleton patch with cover letter
"git format-patch --cover-letter HEAD^" to format a single patch
with a separate cover letter now numbers the output as [PATCH 0/1]
and [PATCH 1/1] by default.
Will merge to 'master'.
* cp/completion-negative-refs (2016-08-24) 1 commit
- completion: support excluding refs
The command-line completion script (in contrib/) learned to
complete "git cmd ^mas<HT>" to complete the negative end of
reference to "git cmd ^master".
Waiting for a review.
* jk/delta-base-cache (2016-08-23) 7 commits
(merged to 'next' on 2016-08-25 at f1c141a)
+ t/perf: add basic perf tests for delta base cache
+ delta_base_cache: use hashmap.h
+ delta_base_cache: drop special treatment of blobs
+ delta_base_cache: use list.h for LRU
+ release_delta_base_cache: reuse existing detach function
+ clear_delta_base_cache_entry: use a more descriptive name
+ cache_or_unpack_entry: drop keep_cache parameter
The delta-base-cache mechanism has been a key to the performance in
a repository with a tightly packed packfile, but it did not scale
well even with a larger value of core.deltaBaseCacheLimit.
Will merge to 'master'.
* js/cat-file-filters (2016-08-24) 4 commits
- cat-file: support --textconv/--filters in batch mode
- cat-file --textconv/--filters: allow specifying the path separately
- cat-file: introduce the --filters option
- cat-file: fix a grammo in the man page
Even though "git hash-objects", which is a tool to take an
on-filesystem data stream and put it into the Git object store,
allowed to perform the "outside-world-to-Git" conversions (e.g.
end-of-line conversions and application of the clean-filter), and
it had the feature on by default from very early days, its reverse
operation "git cat-file", which takes an object from the Git object
store and externalize for the consumption by the outside world,
lacked an equivalent mechanism to run the "Git-to-outside-world"
conversion. The command learned the "--filters" option to do so.
Waiting for a reroll.
cf. <xmqqmvk2qcv8.fsf@gitster.mtv.corp.google.com>
* sb/push-make-submodule-check-the-default (2016-08-24) 1 commit
- push: change submodule default to check
Turn the default of "push.recurseSubmodules" to "check".
Alas, this reveals that the "check" mode is too inefficient to use
in real projects, even in ones as small as git itself.
cf. <xmqqh9aaot49.fsf@gitster.mtv.corp.google.com>
* ak/curl-imap-send-explicit-scheme (2016-08-17) 1 commit
- imap-send: Tell cURL to use imap:// or imaps://
When we started cURL to talk to imap server when a new enough
version of cURL library is available, we forgot to explicitly add
imap(s):// before the destination. To some folks, that didn't work
and the library tried to make HTTP(s) requests instead.
Needs review and testing.
* rt/help-unknown (2016-08-30) 3 commits
(merged to 'next' on 2016-08-30 at db2a5b0)
+ help: make option --help open man pages only for Git commands
+ help: introduce option --exclude-guides
+ Merge branch 'js/no-html-bypass-on-windows' into rt/help-unknown
"git nosuchcommand --help" said "No manual entry for gitnosuchcommand",
which was not intuitive, given that "git nosuchcommand" said "git:
'nosuchcommand' is not a git command".
Will merge to 'master'.
* po/range-doc (2016-08-13) 12 commits
(merged to 'next' on 2016-08-31 at d29870b)
+ doc: revisions: sort examples and fix alignment of the unchanged
+ doc: revisions: show revision expansion in examples
+ doc: revisions - clarify reachability examples
+ doc: revisions - define `reachable`
+ doc: gitrevisions - clarify 'latter case' is revision walk
+ doc: gitrevisions - use 'reachable' in page description
+ doc: revisions: single vs multi-parent notation comparison
+ doc: revisions: extra clarification of <rev>^! notation effects
+ doc: revisions: give headings for the two and three dot notations
+ doc: show the actual left, right, and boundary marks
+ doc: revisions - name the left and right sides
+ doc: use 'symmetric difference' consistently
Clarify various ways to specify the "revision ranges" in the
documentation.
Will merge to 'master'.
* jk/diff-submodule-diff-inline (2016-08-31) 8 commits
(merged to 'next' on 2016-09-02 at 734e42c)
+ diff: teach diff to display submodule difference with an inline diff
+ submodule: refactor show_submodule_summary with helper function
+ submodule: convert show_submodule_summary to use struct object_id *
+ allow do_submodule_path to work even if submodule isn't checked out
+ diff: prepare for additional submodule formats
+ graph: add support for --line-prefix on all graph-aware output
+ diff.c: remove output_prefix_length field
+ cache: add empty_tree_oid object and helper function
The "git diff --submodule={short,log}" mechanism has been enhanced
to allow "--submodule=diff" to show the patch between the submodule
commits bound to the superproject.
Will merge to 'master'.
* jk/reduce-gc-aggressive-depth (2016-08-11) 1 commit
(merged to 'next' on 2016-08-11 at 6810c6f)
+ gc: default aggressive depth to 50
"git gc --aggressive" used to limit the delta-chain length to 250,
which is way too deep for gaining additional space savings and is
detrimental for runtime performance. The limit has been reduced to
50.
Will hold to see if people scream.
* ks/pack-objects-bitmap (2016-08-09) 2 commits
- pack-objects: use reachability bitmap index when generating non-stdout pack
- pack-objects: respect --local/--honor-pack-keep/--incremental when bitmap is in use
Waiting for the review discussion to settle.
cf. <20160818175222.bmm3ivjheokf2qzl@sigill.intra.peff.net>
cf. <20160818180615.q25p57v35m2xxtww@sigill.intra.peff.net>
* sb/submodule-clone-rr (2016-08-17) 8 commits
(merged to 'next' on 2016-08-31 at 08b4b7d)
+ clone: recursive and reference option triggers submodule alternates
+ clone: implement optional references
+ clone: clarify option_reference as required
+ clone: factor out checking for an alternate path
+ submodule--helper update-clone: allow multiple references
+ submodule--helper module-clone: allow multiple references
+ t7408: merge short tests, factor out testing method
+ t7408: modernize style
"git clone --resurse-submodules --reference $path $URL" is a way to
reduce network transfer cost by borrowing objects in an existing
$path repository when cloning the superproject from $URL; it
learned to also peek into $path for presense of corresponding
repositories of submodules and borrow objects from there when able.
Will merge to 'master'.
* jh/status-v2-porcelain (2016-08-12) 9 commits
(merged to 'next' on 2016-08-31 at e71f595)
+ status: unit tests for --porcelain=v2
+ test-lib-functions.sh: add lf_to_nul helper
+ git-status.txt: describe --porcelain=v2 format
+ status: print branch info with --porcelain=v2 --branch
+ status: print per-file porcelain v2 status data
+ status: collect per-file data for --porcelain=v2
+ status: support --porcelain[=<version>]
+ status: cleanup API to wt_status_print
+ status: rename long-format print routines
Enhance "git status --porcelain" output by collecting more data on
the state of the index and the working tree files, which may
further be used to teach git-prompt (in contrib/) to make fewer
calls to git.
Will merge to 'master'.
* mh/diff-indent-heuristic (2016-09-07) 9 commits
- SQAUSH???
- blame: honor the diff heuristic options and config
- parse-options: add parse_opt_unknown_cb()
- diff: improve positioning of add/delete blocks in diffs
- xdl_change_compact(): introduce the concept of a change group
- recs_match(): take two xrecord_t pointers as arguments
- is_blank_line(): take a single xrecord_t as argument
- xdl_change_compact(): only use heuristic if group can't be matched
- xdl_change_compact(): fix compaction heuristic to adjust ixo
Output from "git diff" can be made easier to read by selecting
which lines are common and which lines are added/deleted
intelligently when the lines before and after the changed section
are the same. A command line option is added to help with the
experiment to find a good heuristics.
Rerolled.
Needs adjustment of test numbers. Otherwise looked OK.
* cc/apply-am (2016-09-07) 41 commits
- builtin/am: use apply API in run_apply()
- apply: learn to use a different index file
- apply: pass apply state to build_fake_ancestor()
- apply: refactor `git apply` option parsing
- apply: change error_routine when silent
- usage: add get_error_routine() and get_warn_routine()
- usage: add set_warn_routine()
- apply: don't print on stdout in verbosity_silent mode
- apply: make it possible to silently apply
- apply: use error_errno() where possible
- apply: make some parsing functions static again
- apply: move libified code from builtin/apply.c to apply.{c,h}
- apply: rename and move opt constants to apply.h
- builtin/apply: rename option parsing functions
- builtin/apply: make create_one_file() return -1 on error
- builtin/apply: make try_create_file() return -1 on error
- builtin/apply: make write_out_results() return -1 on error
- builtin/apply: make write_out_one_result() return -1 on error
- builtin/apply: make create_file() return -1 on error
- builtin/apply: make add_index_file() return -1 on error
- builtin/apply: make add_conflicted_stages_file() return -1 on error
- builtin/apply: make remove_file() return -1 on error
- builtin/apply: make build_fake_ancestor() return -1 on error
- builtin/apply: change die_on_unsafe_path() to check_unsafe_path()
- builtin/apply: make gitdiff_*() return -1 on error
- builtin/apply: make gitdiff_*() return 1 at end of header
- builtin/apply: make parse_traditional_patch() return -1 on error
- builtin/apply: make apply_all_patches() return 128 or 1 on error
- builtin/apply: move check_apply_state() to apply.c
- builtin/apply: make check_apply_state() return -1 instead of die()ing
- apply: make init_apply_state() return -1 instead of exit()ing
- builtin/apply: move init_apply_state() to apply.c
- builtin/apply: make parse_ignorewhitespace_option() return -1 instead of die()ing
- builtin/apply: make parse_whitespace_option() return -1 instead of die()ing
- builtin/apply: make parse_single_patch() return -1 on error
- builtin/apply: make parse_chunk() return a negative integer on error
- builtin/apply: make find_header() return -128 instead of die()ing
- builtin/apply: read_patch_file() return -1 instead of die()ing
- builtin/apply: make apply_patch() return -1 or -128 instead of die()ing
- apply: move 'struct apply_state' to apply.h
- apply: make some names more specific
"git am" has been taught to make an internal call to "git apply"'s
innards without spawning the latter as a separate process.
Will merge to 'next'.
* jk/pack-objects-optim-mru (2016-08-11) 4 commits
(merged to 'next' on 2016-08-11 at c0a7dae)
+ pack-objects: use mru list when iterating over packs
+ pack-objects: break delta cycles before delta-search phase
+ sha1_file: make packed_object_info public
+ provide an initializer for "struct object_info"
"git pack-objects" in a repository with many packfiles used to
spend a lot of time looking for/at objects in them; the accesses to
the packfiles are now optimized by checking the most-recently-used
packfile first.
Will hold to see if people scream.
* jk/rebase-i-drop-ident-check (2016-07-29) 1 commit
(merged to 'next' on 2016-08-14 at 6891bcd)
+ rebase-interactive: drop early check for valid ident
Even when "git pull --rebase=preserve" (and the underlying "git
rebase --preserve") can complete without creating any new commit
(i.e. fast-forwards), it still insisted on having a usable ident
information (read: user.email is set correctly), which was less
than nice. As the underlying commands used inside "git rebase"
would fail with a more meaningful error message and advice text
when the bogus ident matters, this extra check was removed.
Will hold to see if people scream.
cf. <20160729224944.GA23242@sigill.intra.peff.net>
* dp/autoconf-curl-ssl (2016-06-28) 1 commit
- ./configure.ac: detect SSL in libcurl using curl-config
The ./configure script generated from configure.ac was taught how
to detect support of SSL by libcurl better.
Needs review.
* jc/pull-rebase-ff (2016-07-28) 1 commit
- pull: fast-forward "pull --rebase=true"
"git pull --rebase", when there is no new commits on our side since
we forked from the upstream, should be able to fast-forward without
invoking "git rebase", but it didn't.
Needs a real log message and a few tests.
* ex/deprecate-empty-pathspec-as-match-all (2016-06-22) 1 commit
(merged to 'next' on 2016-07-13 at d9ca7fb)
+ pathspec: warn on empty strings as pathspec
An empty string used as a pathspec element has always meant
'everything matches', but it is too easy to write a script that
finds a path to remove in $path and run 'git rm "$paht"', which
ends up removing everything. Start warning about this use of an
empty string used for 'everything matches' and ask users to use a
more explicit '.' for that instead.
The hope is that existing users will not mind this change, and
eventually the warning can be turned into a hard error, upgrading
the deprecation into removal of this (mis)feature.
Will hold to see if people scream.
* mh/ref-store (2016-06-20) 38 commits
- refs: implement iteration over only per-worktree refs
- refs: make lock generic
- refs: add method to rename refs
- refs: add methods to init refs db
- refs: make delete_refs() virtual
- refs: add method for initial ref transaction commit
- refs: add methods for reflog
- refs: add method iterator_begin
- files_ref_iterator_begin(): take a ref_store argument
- split_symref_update(): add a files_ref_store argument
- lock_ref_sha1_basic(): add a files_ref_store argument
- lock_ref_for_update(): add a files_ref_store argument
- commit_ref_update(): add a files_ref_store argument
- lock_raw_ref(): add a files_ref_store argument
- repack_without_refs(): add a files_ref_store argument
- refs: make peel_ref() virtual
- refs: make create_symref() virtual
- refs: make pack_refs() virtual
- refs: make verify_refname_available() virtual
- refs: make read_raw_ref() virtual
- resolve_gitlink_ref(): rename path parameter to submodule
- resolve_gitlink_ref(): avoid memory allocation in many cases
- resolve_gitlink_ref(): implement using resolve_ref_recursively()
- resolve_ref_recursively(): new function
- read_raw_ref(): take a (struct ref_store *) argument
- resolve_gitlink_packed_ref(): remove function
- resolve_packed_ref(): rename function from resolve_missing_loose_ref()
- refs: reorder definitions
- refs: add a transaction_commit() method
- {lock,commit,rollback}_packed_refs(): add files_ref_store arguments
- resolve_missing_loose_ref(): add a files_ref_store argument
- get_packed_ref(): add a files_ref_store argument
- add_packed_ref(): add a files_ref_store argument
- refs: create a base class "ref_store" for files_ref_store
- refs: add a backend method structure
- refs: rename struct ref_cache to files_ref_store
- rename_ref_available(): add docstring
- resolve_gitlink_ref(): eliminate temporary variable
The ref-store abstraction was introduced to the refs API so that we
can plug in different backends to store references.
Needs a fixup.
cf. <576D9885.2020901@ramsayjones.plus.com>
* nd/shallow-deepen (2016-06-13) 27 commits
- fetch, upload-pack: --deepen=N extends shallow boundary by N commits
- upload-pack: add get_reachable_list()
- upload-pack: split check_unreachable() in two, prep for get_reachable_list()
- t5500, t5539: tests for shallow depth excluding a ref
- clone: define shallow clone boundary with --shallow-exclude
- fetch: define shallow boundary with --shallow-exclude
- upload-pack: support define shallow boundary by excluding revisions
- refs: add expand_ref()
- t5500, t5539: tests for shallow depth since a specific date
- clone: define shallow clone boundary based on time with --shallow-since
- fetch: define shallow boundary with --shallow-since
- upload-pack: add deepen-since to cut shallow repos based on time
- shallow.c: implement a generic shallow boundary finder based on rev-list
- fetch-pack: use a separate flag for fetch in deepening mode
- fetch-pack.c: mark strings for translating
- fetch-pack: use a common function for verbose printing
- fetch-pack: use skip_prefix() instead of starts_with()
- upload-pack: move rev-list code out of check_non_tip()
- upload-pack: make check_non_tip() clean things up on error
- upload-pack: tighten number parsing at "deepen" lines
- upload-pack: use skip_prefix() instead of starts_with()
- upload-pack: move "unshallow" sending code out of deepen()
- upload-pack: remove unused variable "backup"
- upload-pack: move "shallow" sending code out of deepen()
- upload-pack: move shallow deepen code out of receive_needs()
- transport-helper.c: refactor set_helper_option()
- remote-curl.c: convert fetch_git() to use argv_array
The existing "git fetch --depth=<n>" option was hard to use
correctly when making the history of an existing shallow clone
deeper. A new option, "--deepen=<n>", has been added to make this
easier to use. "git clone" also learned "--shallow-since=<date>"
and "--shallow-exclude=<tag>" options to make it easier to specify
"I am interested only in the recent N months worth of history" and
"Give me only the history since that version".
Needs review.
Rerolled. What this topic attempts to achieve is worthwhile, I
would think.
* pb/bisect (2016-08-23) 27 commits
. bisect--helper: remove the dequote in bisect_start()
. bisect--helper: retire `--bisect-auto-next` subcommand
. bisect--helper: retire `--bisect-autostart` subcommand
. bisect--helper: retire `--check-and-set-terms` subcommand
. bisect--helper: retire `--bisect-write` subcommand
. bisect--helper: `bisect_replay` shell function in C
. bisect--helper: `bisect_log` shell function in C
. bisect--helper: retire `--write-terms` subcommand
. bisect--helper: retire `--check-expected-revs` subcommand
. bisect--helper: `bisect_state` & `bisect_head` shell function in C
. bisect--helper: `bisect_autostart` shell function in C
. bisect--helper: retire `--next-all` subcommand
. bisect--helper: retire `--bisect-clean-state` subcommand
. bisect--helper: `bisect_next` and `bisect_auto_next` shell function in C
. bisect--helper: `bisect_start` shell function partially in C
. bisect--helper: `get_terms` & `bisect_terms` shell function in C
. bisect--helper: `bisect_next_check` & bisect_voc shell function in C
. bisect--helper: `check_and_set_terms` shell function in C
. bisect--helper: `bisect_write` shell function in C
. bisect--helper: `is_expected_rev` & `check_expected_revs` shell function in C
. bisect--helper: `bisect_reset` shell function in C
. wrapper: move is_empty_file() and rename it as is_empty_or_missing_file()
. t6030: explicitly test for bisection cleanup
. bisect--helper: `bisect_clean_state` shell function in C
. bisect--helper: `write_terms` shell function in C
. bisect: rewrite `check_term_format` shell function in C
. bisect--helper: use OPT_CMDMODE instead of OPT_BOOL
GSoC "bisect" topic.
I'd prefer to see early part solidified so that reviews can focus
on the later part that is still in flux. We are almost there but
not quite yet.
* kn/ref-filter-branch-list (2016-05-17) 17 commits
- branch: implement '--format' option
- branch: use ref-filter printing APIs
- branch, tag: use porcelain output
- ref-filter: allow porcelain to translate messages in the output
- ref-filter: add `:dir` and `:base` options for ref printing atoms
- ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()
- ref-filter: introduce symref_atom_parser() and refname_atom_parser()
- ref-filter: introduce refname_atom_parser_internal()
- ref-filter: make "%(symref)" atom work with the ':short' modifier
- ref-filter: add support for %(upstream:track,nobracket)
- ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams
- ref-filter: introduce format_ref_array_item()
- ref-filter: move get_head_description() from branch.c
- ref-filter: modify "%(objectname:short)" to take length
- ref-filter: implement %(if:equals=<string>) and %(if:notequals=<string>)
- ref-filter: include reference to 'used_atom' within 'atom_value'
- ref-filter: implement %(if), %(then), and %(else) atoms
The code to list branches in "git branch" has been consolidated
with the more generic ref-filter API.
Rerolled.
Needs review.
* jc/merge-drop-old-syntax (2015-04-29) 1 commit
- merge: drop 'git merge <message> HEAD <commit>' syntax
Stop supporting "git merge <message> HEAD <commit>" syntax that has
been deprecated since October 2007, and issues a deprecation
warning message since v2.5.0.
It has been reported that git-gui still uses the deprecated syntax,
which needs to be fixed before this final step can proceed.
cf. <5671DB28.8020901@kdbg.org>
^ permalink raw reply
* [PATCH] Allow stashes to be referenced by index only
From: Aaron M Watson @ 2016-09-08 23:46 UTC (permalink / raw)
To: git
Cc: Aaron M Watson, Jon Seymour, David Caldwell, Øystein Walle,
Jeff King, Ævar Arnfjörð Bjarmason, David Aguilar,
Alex Henrie
Instead of referencing "stash@{n}" explicitly, it can simply be
referenced as "n". Most users only reference stashes by their position
in the stash stask (what I refer to as the "index"). The syntax for the
typical stash (stash@{n}) is slightly annoying and easy to forget, and
sometimes difficult to escape properly in a script. Because of this the
capability to do things with the stash by simply referencing the index
is desirable.
This patch includes the superior implementation provided by Øsse Walle
(thanks for that), with a slight change to fix a broken test in the test
suite. I also merged the test scripts as suggested by Jeff King, and
un-wrapped the documentation as suggested by Junio Hamano.
Signed-off-by: Aaron M Watson <watsona4@gmail.com>
---
Documentation/git-stash.txt | 3 ++-
git-stash.sh | 17 +++++++++++++++--
t/t3903-stash.sh | 35 +++++++++++++++++++++++++++++++++++
3 files changed, 52 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 92df596..2e9cef0 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -39,7 +39,8 @@ The latest stash you created is stored in `refs/stash`; older
stashes are found in the reflog of this reference and can be named using
the usual reflog syntax (e.g. `stash@{0}` is the most recently
created stash, `stash@{1}` is the one before it, `stash@{2.hours.ago}`
-is also possible).
+is also possible). Stashes may also be referenced by specifying just the
+stash index (e.g. the integer `n` is equivalent to `stash@{n}`).
OPTIONS
-------
diff --git a/git-stash.sh b/git-stash.sh
index 826af18..d8d3b8d 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -384,9 +384,10 @@ parse_flags_and_rev()
i_tree=
u_tree=
- REV=$(git rev-parse --no-flags --symbolic --sq "$@") || exit 1
+ REV=$(git rev-parse --no-flags --symbolic --sq "$@" 2> /dev/null)
FLAGS=
+ ARGV=
for opt
do
case "$opt" in
@@ -404,10 +405,13 @@ parse_flags_and_rev()
die "$(eval_gettext "unknown option: \$opt")"
FLAGS="${FLAGS}${FLAGS:+ }$opt"
;;
+ *)
+ ARGV="${ARGV}${ARGV:+ }'$opt'"
+ ;;
esac
done
- eval set -- $REV
+ eval set -- $ARGV
case $# in
0)
@@ -422,6 +426,15 @@ parse_flags_and_rev()
;;
esac
+ case "$1" in
+ *[!0-9]*)
+ :
+ ;;
+ *)
+ set -- "${ref_stash}@{$1}"
+ ;;
+ esac
+
REV=$(git rev-parse --symbolic --verify --quiet "$1") || {
reference="$1"
die "$(eval_gettext "\$reference is not a valid reference")"
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 2142c1f..f82a8c4 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -131,6 +131,26 @@ test_expect_success 'drop middle stash' '
test 1 = $(git show HEAD:file)
'
+test_expect_success 'drop middle stash by index' '
+ git reset --hard &&
+ echo 8 > file &&
+ git stash &&
+ echo 9 > file &&
+ git stash &&
+ git stash drop 1 &&
+ test 2 = $(git stash list | wc -l) &&
+ git stash apply &&
+ test 9 = $(cat file) &&
+ test 1 = $(git show :file) &&
+ test 1 = $(git show HEAD:file) &&
+ git reset --hard &&
+ git stash drop &&
+ git stash apply &&
+ test 3 = $(cat file) &&
+ test 1 = $(git show :file) &&
+ test 1 = $(git show HEAD:file)
+'
+
test_expect_success 'stash pop' '
git reset --hard &&
git stash pop &&
@@ -604,6 +624,21 @@ test_expect_success 'invalid ref of the form stash@{n}, n >= N' '
git stash drop
'
+test_expect_success 'invalid ref of the form "n", n >= N' '
+ git stash clear &&
+ test_must_fail git stash drop 0 &&
+ echo bar5 > file &&
+ echo bar6 > file2 &&
+ git add file2 &&
+ git stash &&
+ test_must_fail git stash drop 1 &&
+ test_must_fail git stash pop 1 &&
+ test_must_fail git stash apply 1 &&
+ test_must_fail git stash show 1 &&
+ test_must_fail git stash branch tmp 1 &&
+ git stash drop
+'
+
test_expect_success 'stash branch should not drop the stash if the branch exists' '
git stash clear &&
echo foo >file &&
--
2.7.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox