* Re: [PATCH v1 1/4] transport-helper: use xread instead of read
From: Junio C Hamano @ 2018-12-28 20:10 UTC (permalink / raw)
To: randall.s.becker; +Cc: git, Randall S. Becker
In-Reply-To: <20181226230523.16572-2-randall.s.becker@rogers.com>
randall.s.becker@rogers.com writes:
> From: "Randall S. Becker" <rsbecker@nexbridge.com>
>
> This fix was needed on HPE NonStop NSE and NSX where SSIZE_MAX is less than
> BUFFERSIZE resulting in EINVAL. The call to read in transport-helper.c
> was the only place outside of wrapper.c where it is used instead of xread.
>
> Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
> ---
> transport-helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/transport-helper.c b/transport-helper.c
> index bf225c698f..a290695a12 100644
> --- a/transport-helper.c
> +++ b/transport-helper.c
> @@ -1225,7 +1225,7 @@ static int udt_do_read(struct unidirectional_transfer *t)
> return 0; /* No space for more. */
>
> transfer_debug("%s is readable", t->src_name);
> - bytes = read(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
> + bytes = xread(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
> if (bytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN &&
> errno != EINTR) {
> error_errno(_("read(%s) failed"), t->src_name);
As Peff pointed out in the earlier round of the same patch,
replacing read() with xread() here will affect what errno's can be
possible after the function returns. The checks affected by this
change must also be updated, either in the same patch, or a
follow-up patch in the same series. Otherwise we _will_ forget to
clean them up.
^ permalink raw reply
* RE: [PATCH v3 2/4] config.mak.uname: support for modern HPE NonStop config.
From: Randall S. Becker @ 2018-12-28 20:03 UTC (permalink / raw)
To: 'Eric Sunshine'; +Cc: 'Git List'
In-Reply-To: <CAPig+cTjn4je8dOANs-xHhU_NYRw-Twm22HSnSLNXTkDB-qRYw@mail.gmail.com>
On December 28, 2018 14:43, Eric Sunshine wrote:
> On Thu, Dec 27, 2018 at 5:39 PM <randall.s.becker@rogers.com> wrote:
> > A number of configuration options are not automatically detected by
> > configure mechanisms, including the location of Perl and Python.
> >
> > There was a problem at a specific set of operating system versions
> > that caused getopt to have compile errors. Account for this by
> > providing emulation defines for those versions.
>
> This version of the patch looks much better and addresses my comments on
> previous attempts. One note below...
>
> > Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
> > ---
> > diff --git a/config.mak.uname b/config.mak.uname @@ -441,26 +441,45
> @@
> > ifeq ($(uname_S),NONSTOP_KERNEL)
> > + # The current /usr/coreutils/rm at lowest support level does not work
> > + # with the git test structure. Long paths cause nftw as in
> > + # 'trash directory...' cause rm to terminate prematurely without fully
> > + # removing the directory at OS releases J06.21 and L17.02.
> > + # Default to the older rm until those two releases are deprecated.
> > + RM = /bin/rm -f
>
> Thanks, this comment does a much better job of explaining the actual
> problem and selling the solution.
>
> There is a slight grammatical problem:
>
> Long paths _cause_ ... _cause_ rm to terminate...
>
> which might deserve fixing.
Rerolled. Thanks.
^ permalink raw reply
* [PATCH v4 2/4] config.mak.uname: support for modern HPE NonStop config.
From: randall.s.becker @ 2018-12-28 20:02 UTC (permalink / raw)
To: git; +Cc: Randall S. Becker
From: "Randall S. Becker" <rsbecker@nexbridge.com>
A number of configuration options are not automatically detected by
configure mechanisms, including the location of Perl and Python.
There was a problem at a specific set of operating system versions
that caused getopt to have compile errors. Account for this by
providing emulation defines for those versions.
Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
---
config.mak.uname | 34 +++++++++++++++++++++++++++++-----
1 file changed, 29 insertions(+), 5 deletions(-)
diff --git a/config.mak.uname b/config.mak.uname
index 3ee7da0e23..aa4432ac2f 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -441,26 +441,45 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
# INLINE='' would just replace one set of warnings with another and
# still not compile in c89 mode, due to non-const array initializations.
CC = cc -c99
+ # Build down-rev compatible objects that don't use our new getopt_long.
+ ifeq ($(uname_R).$(uname_V),J06.21)
+ CC += -WRVU=J06.20
+ endif
+ ifeq ($(uname_R).$(uname_V),L17.02)
+ CC += -WRVU=L16.05
+ endif
+
# Disable all optimization, seems to result in bad code, with -O or -O2
# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects
# abends on "git push". Needs more investigation.
- CFLAGS = -g -O0
+ CFLAGS = -g -O0 -Winline
# We'd want it to be here.
prefix = /usr/local
- # Our's are in ${prefix}/bin (perl might also be in /usr/bin/perl).
+ # perl and python must be in /usr/bin on NonStop - supplied by HPE
+ # with operating system in that managed directory.
- PERL_PATH = ${prefix}/bin/perl
- PYTHON_PATH = ${prefix}/bin/python
-
+ PERL_PATH = /usr/bin/perl
+ PYTHON_PATH = /usr/bin/python
+ # The current /usr/coreutils/rm at lowest support level does not work
+ # with the git test structure. Long paths as in
+ # 'trash directory...' cause rm to terminate prematurely without fully
+ # removing the directory at OS releases J06.21 and L17.02.
+ # Default to the older rm until those two releases are deprecated.
+ RM = /bin/rm -f
# As detected by './configure'.
# Missdetected, hence commented out, see below.
#NO_CURL = YesPlease
# Added manually, see above.
+ NEEDS_SSL_WITH_CURL = YesPlease
+ NEEDS_CRYPTO_WITH_SSL = YesPlease
+ HAVE_DEV_TTY = YesPlease
HAVE_LIBCHARSET_H = YesPlease
HAVE_STRINGS_H = YesPlease
NEEDS_LIBICONV = YesPlease
NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
NO_SYS_SELECT_H = UnfortunatelyYes
NO_D_TYPE_IN_DIRENT = YesPlease
+ NO_GETTEXT = YesPlease
NO_HSTRERROR = YesPlease
NO_STRCASESTR = YesPlease
NO_MEMMEM = YesPlease
@@ -470,8 +489,13 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
NO_MKDTEMP = YesPlease
# Currently libiconv-1.9.1.
OLD_ICONV = UnfortunatelyYes
- NO_REGEX = YesPlease
+ NO_REGEX=NeedsStartEnd
NO_PTHREADS = UnfortunatelyYes
# Not detected (nor checked for) by './configure'.
# We don't have SA_RESTART on NonStop, unfortunalety.
--
2.17.0.10.gb132f7033
^ permalink raw reply related
* Re: [PATCH 2/2] Unset CURLOPT_FAILONERROR
From: Masaya Suzuki @ 2018-12-28 20:00 UTC (permalink / raw)
To: Eric Sunshine; +Cc: Git List, Jeff King, Jonathan Nieder
In-Reply-To: <CAPig+cTOK9XkGiPcHdVrWbV-L0a+Av0Kv=NcRVYsUHnb0j5-Zw@mail.gmail.com>
On Fri, Dec 28, 2018 at 11:58 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
>
> On Fri, Dec 28, 2018 at 2:51 PM Masaya Suzuki <masayasuzuki@google.com> wrote:
> > On Fri, Dec 28, 2018 at 11:37 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
> > > On Thu, Dec 27, 2018 at 8:47 PM Masaya Suzuki <masayasuzuki@google.com> wrote:
> > > > +test_expect_success 'failure in git-upload-pack is shown' '
> > > > + (GIT_CURL_VERBOSE=1 git clone --bare "$HTTPD_URL/error_git_upload_pack/smart/repo.git" 2>curl_log ||
> > > > + true) &&
> > >
> > > Using test_might_fail() would allow you to drop the subshell and the "|| true":
> > >
> > > test_might_fail env GIT_CURL_VERBOSE=1 git clone ... &&
> > >
> > > > + cat curl_log | grep "< HTTP/1.1 500 Intentional Breakage"
> > > > +'
> >
> > The test should success. This is a test that a log is produced after a
> > git command fails. The point of this test is "cat curl_log | grep ..."
> > part that asserts the log.
>
> Unfortunately, the name "test_might_fail" is confusing. It is not
> saying that the entire test might or might not fail. Rather, it is
> saying that the one command might or might not fail (and that you
> don't care if it does fail). The idiom:
>
> (some-git-command || true) &&
>
> can be replaced with:
>
> test_might_fail some-git-command &&
>
> without changing its meaning, and without affecting the
> success/failure status of the test overall.
>
> So, this new test could be written like this:
>
> --- 8< ---
> test_expect_success 'failure in git-upload-pack is shown' '
> test_might_fail env GIT_CURL_VERBOSE=1 git clone --bare
> "$HTTPD_URL/error_git_upload_pack/smart/repo.git" 2>curl_log &&
> cat curl_log | grep "< HTTP/1.1 500 Intentional Breakage"
> '
> --- 8< ---
>
> and have the same meaning.
Ah. I see. It's used inside the test. Thanks.
^ permalink raw reply
* Re: [PATCH v2] sha1-name.c: Fix handling of revisions that contain paths with brackets
From: Junio C Hamano @ 2018-12-28 19:59 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Stan Hu, git
In-Reply-To: <20181224080651.GA12708@duynguyen.home>
Duy Nguyen <pclouds@gmail.com> writes:
> Note that it also shows another corner case we need to be careful
> about: master^{/regex} syntax _can_ contain colons in regex. I suppose
> doing strchr to find the closing '}' here is better than what I did
> below.
Yes, the posted patch breaks master^{/foo:bar}, I suppose.
^ permalink raw reply
* Re: [PATCH 2/2] Unset CURLOPT_FAILONERROR
From: Eric Sunshine @ 2018-12-28 19:58 UTC (permalink / raw)
To: Masaya Suzuki; +Cc: Git List, Jeff King, Jonathan Nieder
In-Reply-To: <CAJB1erXq3JZMd9XwUZFHp80Hr2kRakrp3JJgrAugXPyjp1rxNg@mail.gmail.com>
On Fri, Dec 28, 2018 at 2:51 PM Masaya Suzuki <masayasuzuki@google.com> wrote:
> On Fri, Dec 28, 2018 at 11:37 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
> > On Thu, Dec 27, 2018 at 8:47 PM Masaya Suzuki <masayasuzuki@google.com> wrote:
> > > +test_expect_success 'failure in git-upload-pack is shown' '
> > > + (GIT_CURL_VERBOSE=1 git clone --bare "$HTTPD_URL/error_git_upload_pack/smart/repo.git" 2>curl_log ||
> > > + true) &&
> >
> > Using test_might_fail() would allow you to drop the subshell and the "|| true":
> >
> > test_might_fail env GIT_CURL_VERBOSE=1 git clone ... &&
> >
> > > + cat curl_log | grep "< HTTP/1.1 500 Intentional Breakage"
> > > +'
>
> The test should success. This is a test that a log is produced after a
> git command fails. The point of this test is "cat curl_log | grep ..."
> part that asserts the log.
Unfortunately, the name "test_might_fail" is confusing. It is not
saying that the entire test might or might not fail. Rather, it is
saying that the one command might or might not fail (and that you
don't care if it does fail). The idiom:
(some-git-command || true) &&
can be replaced with:
test_might_fail some-git-command &&
without changing its meaning, and without affecting the
success/failure status of the test overall.
So, this new test could be written like this:
--- 8< ---
test_expect_success 'failure in git-upload-pack is shown' '
test_might_fail env GIT_CURL_VERBOSE=1 git clone --bare
"$HTTPD_URL/error_git_upload_pack/smart/repo.git" 2>curl_log &&
cat curl_log | grep "< HTTP/1.1 500 Intentional Breakage"
'
--- 8< ---
and have the same meaning.
^ permalink raw reply
* Re: [PATCH 2/2] Unset CURLOPT_FAILONERROR
From: Masaya Suzuki @ 2018-12-28 19:51 UTC (permalink / raw)
To: Eric Sunshine; +Cc: Git List, Jeff King, Jonathan Nieder
In-Reply-To: <CAPig+cQc6oF3b03XS2jmNdtUDOX_08tv=AMUpdd7D1eDto33=A@mail.gmail.com>
On Fri, Dec 28, 2018 at 11:37 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
>
> On Thu, Dec 27, 2018 at 8:47 PM Masaya Suzuki <masayasuzuki@google.com> wrote:
> > When GIT_CURL_VERBOSE is set, libcurl produces request/response headers
> > to stderr. However, if the response is an error response and
> > CURLOPT_FAILONERROR is set, libcurl stops parsing the response, and it
> > won't ump the headers. Showing HTTP response headers is useful for
>
> s/ump/dump/
>
> > debugging, especially for non-OK responses.
> >
> > This is substantially same as setting http_options.keep_error to all
> > requests. Hence, removing this option.
>
> s/removing/remove/
>
> > Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
> > ---
> > diff --git a/t/t5581-http-curl-verbose.sh b/t/t5581-http-curl-verbose.sh
> > @@ -0,0 +1,32 @@
> > +test_expect_success 'setup repository' '
> > + ...
> > +'
> > +
> > +test_expect_success 'create http-accessible bare repository' '
>
> Not a big deal, but this seems like more setup, so it could be folded
> into the "setup" test above it.
>
> > + mkdir "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
> > + (cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
> > + git --bare init
> > + ) &&
>
> Since this is a new test script, it makes sense to format the subshell
> in the modern style:
>
> (
> cd ... &&
> git ...
> ) &&
>
> Alternately, use -C and drop the subshell altogether:
>
> git -C $BLAH/repo.git --bare init &&
>
> > + git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
> > + git push public master:master
> > +'
> > +
> > +test_expect_success 'failure in git-upload-pack is shown' '
> > + (GIT_CURL_VERBOSE=1 git clone --bare "$HTTPD_URL/error_git_upload_pack/smart/repo.git" 2>curl_log ||
> > + true) &&
>
> Using test_might_fail() would allow you to drop the subshell and the "|| true":
>
> test_might_fail env GIT_CURL_VERBOSE=1 git clone ... &&
>
> > + cat curl_log | grep "< HTTP/1.1 500 Intentional Breakage"
> > +'
The test should success. This is a test that a log is produced after a
git command fails. The point of this test is "cat curl_log | grep ..."
part that asserts the log.
^ permalink raw reply
* Re: [PATCH v3 2/4] config.mak.uname: support for modern HPE NonStop config.
From: Eric Sunshine @ 2018-12-28 19:42 UTC (permalink / raw)
To: randall.s.becker; +Cc: Git List, Randall S. Becker
In-Reply-To: <20181227223856.18768-1-randall.s.becker@rogers.com>
On Thu, Dec 27, 2018 at 5:39 PM <randall.s.becker@rogers.com> wrote:
> A number of configuration options are not automatically detected by
> configure mechanisms, including the location of Perl and Python.
>
> There was a problem at a specific set of operating system versions
> that caused getopt to have compile errors. Account for this by
> providing emulation defines for those versions.
This version of the patch looks much better and addresses my comments
on previous attempts. One note below...
> Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
> ---
> diff --git a/config.mak.uname b/config.mak.uname
> @@ -441,26 +441,45 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
> + # The current /usr/coreutils/rm at lowest support level does not work
> + # with the git test structure. Long paths cause nftw as in
> + # 'trash directory...' cause rm to terminate prematurely without fully
> + # removing the directory at OS releases J06.21 and L17.02.
> + # Default to the older rm until those two releases are deprecated.
> + RM = /bin/rm -f
Thanks, this comment does a much better job of explaining the actual
problem and selling the solution.
There is a slight grammatical problem:
Long paths _cause_ ... _cause_ rm to terminate...
which might deserve fixing.
^ permalink raw reply
* Re: [PATCH v3 06/16] sequencer: refactor sequencer_add_exec_commands() to work on a todo_list
From: Alban Gruin @ 2018-12-28 19:42 UTC (permalink / raw)
To: phillip.wood, Johannes Schindelin; +Cc: git, Junio C Hamano
In-Reply-To: <a1a828e5-6faa-b1f2-20c3-a53b1a3d779a@talktalk.net>
Hi Phillip and Johannes,
many thanks for your suggestions and feedback, I really appreciate it.
Le 10/12/2018 à 15:33, Phillip Wood a écrit :
> On 30/11/2018 19:06, Johannes Schindelin wrote:
>> Hi,
>>
>> On Fri, 30 Nov 2018, Phillip Wood wrote:
>>
>>>> diff --git a/sequencer.c b/sequencer.c
>>>> index 900899ef20..11692d0b98 100644
>>>> --- a/sequencer.c
>>>> +++ b/sequencer.c
>>>> @@ -4394,24 +4394,29 @@ int sequencer_make_script(FILE *out, int
>>>> argc, const
>>>> char **argv,
>>>> return 0;
>>>> }
>>>> -/*
>>>> - * Add commands after pick and (series of) squash/fixup commands
>>>> - * in the todo list.
>>>> - */
>>>> -int sequencer_add_exec_commands(const char *commands)
>>>> +static void todo_list_add_exec_commands(struct todo_list *todo_list,
>>>> + struct string_list *commands)
>>>> {
>>>> - const char *todo_file = rebase_path_todo();
>>>> - struct todo_list todo_list = TODO_LIST_INIT;
>>>> - struct strbuf *buf = &todo_list.buf;
>>>> - size_t offset = 0, commands_len = strlen(commands);
>>>> - int i, insert;
>>>> + struct strbuf *buf = &todo_list->buf;
>>>> + const char *old_buf = buf->buf;
>>>> + size_t base_length = buf->len;
>>>> + int i, insert, nr = 0, alloc = 0;
>>>> + struct todo_item *items = NULL, *base_items = NULL;
>>>>
>>>> - if (strbuf_read_file(&todo_list.buf, todo_file, 0) < 0)
>>>> - return error(_("could not read '%s'."), todo_file);
>>>> + for (i = 0; i < commands->nr; ++i) {
>>>> + strbuf_addstr(buf, commands->items[i].string);
>>>> + strbuf_addch(buf, '\n');
>>>> + }
>>>
>>> This could cause buf->buf to be reallocated in which case all the
>>> todo_list_item.arg pointers will be invalidated.
>>
>> I guess it is a good time for me to admit that the `arg` idea was not my
>> best. Maybe it would be good to convert that from a pointer to an offset,
>> e.g. `size_t arg_offset_in_buf;`? Or maybe we should just drop the
>> `_in_buf` suffix and clarify in a comment next to the declaration of the
>> fields that they are offsets in the strbuf?
>
> I think that sounds sensible (though I haven't looked at how much work
> it would be), having a comment and calling it arg_offset would be my
> preference.
>
It’s not a lot of work, actually. Most usages of 'arg' are concentrated
in two functions (parse_insn_line() and pick_commits()). Some of the
subsequent patches of this series also use 'arg', and adapting them is
trivial.
In the end, most of the work went into todo_list_add_exec_commands(),
and the result is pretty clean.
Cheers,
Alban
^ permalink raw reply
* Re: [PATCH 2/2] Unset CURLOPT_FAILONERROR
From: Eric Sunshine @ 2018-12-28 19:36 UTC (permalink / raw)
To: Masaya Suzuki; +Cc: Git List, Jeff King, Jonathan Nieder
In-Reply-To: <20181228014720.206443-2-masayasuzuki@google.com>
On Thu, Dec 27, 2018 at 8:47 PM Masaya Suzuki <masayasuzuki@google.com> wrote:
> When GIT_CURL_VERBOSE is set, libcurl produces request/response headers
> to stderr. However, if the response is an error response and
> CURLOPT_FAILONERROR is set, libcurl stops parsing the response, and it
> won't ump the headers. Showing HTTP response headers is useful for
s/ump/dump/
> debugging, especially for non-OK responses.
>
> This is substantially same as setting http_options.keep_error to all
> requests. Hence, removing this option.
s/removing/remove/
> Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
> ---
> diff --git a/t/t5581-http-curl-verbose.sh b/t/t5581-http-curl-verbose.sh
> @@ -0,0 +1,32 @@
> +test_expect_success 'setup repository' '
> + ...
> +'
> +
> +test_expect_success 'create http-accessible bare repository' '
Not a big deal, but this seems like more setup, so it could be folded
into the "setup" test above it.
> + mkdir "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
> + (cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
> + git --bare init
> + ) &&
Since this is a new test script, it makes sense to format the subshell
in the modern style:
(
cd ... &&
git ...
) &&
Alternately, use -C and drop the subshell altogether:
git -C $BLAH/repo.git --bare init &&
> + git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
> + git push public master:master
> +'
> +
> +test_expect_success 'failure in git-upload-pack is shown' '
> + (GIT_CURL_VERBOSE=1 git clone --bare "$HTTPD_URL/error_git_upload_pack/smart/repo.git" 2>curl_log ||
> + true) &&
Using test_might_fail() would allow you to drop the subshell and the "|| true":
test_might_fail env GIT_CURL_VERBOSE=1 git clone ... &&
> + cat curl_log | grep "< HTTP/1.1 500 Intentional Breakage"
> +'
^ permalink raw reply
* ag/sequencer-reduce-rewriting-todo, was Re: What's cooking in git.git (Dec 2018, #02; Fri, 28)
From: Alban Gruin @ 2018-12-28 19:21 UTC (permalink / raw)
To: Junio C Hamano, git
In-Reply-To: <xmqqh8explya.fsf@gitster-ct.c.googlers.com>
Hi Junio,
Le 28/12/2018 à 19:04, Junio C Hamano a écrit :
> * ag/sequencer-reduce-rewriting-todo (2018-11-12) 16 commits
> . rebase--interactive: move transform_todo_file() to rebase--interactive.c
> . sequencer: fix a call to error() in transform_todo_file()
> . sequencer: use edit_todo_list() in complete_action()
> . rebase-interactive: rewrite edit_todo_list() to handle the initial edit
> . rebase-interactive: append_todo_help() changes
> . rebase-interactive: use todo_list_write_to_file() in edit_todo_list()
> . sequencer: refactor skip_unnecessary_picks() to work on a todo_list
> . sequencer: change complete_action() to use the refactored functions
> . sequencer: make sequencer_make_script() write its script to a strbuf
> . sequencer: refactor rearrange_squash() to work on a todo_list
> . sequencer: refactor sequencer_add_exec_commands() to work on a todo_list
> . sequencer: refactor check_todo_list() to work on a todo_list
> . sequencer: introduce todo_list_write_to_file()
> . sequencer: refactor transform_todos() to work on a todo_list
> . sequencer: make the todo_list structure public
> . sequencer: changes in parse_insn_buffer()
>
> The scripted version of "git rebase -i" wrote and rewrote the todo
> list many times during a single step of its operation, and the
> recent C-rewrite made a faithful conversion of the logic to C. The
> implementation has been updated to carry necessary information
> around in-core to avoid rewriting the same file over and over
> unnecessarily.
>
> With too many topics in-flight that touch sequencer and rebaser,
> this need to wait giving precedence to other topics that fix bugs.
>
>
Most of these topics have reached master and have been released in git
2.20. Currently, there is four topics actually touching rebase,
interactive rebase and/or the sequencer (js/rebase-i-redo-exec,
nd/backup-log, en/rebase-merge-on-sequencer and nd/the-index). Among
these, only nd/the-index conflicts with my series.
Should I consider this comment as outdated, and reroll my series
(rebased on top of nd/the-index) in the next few days?
Cheers,
Alban
^ permalink raw reply
* Re: What's cooking in git.git (Dec 2018, #02; Fri, 28)
From: Elijah Newren @ 2018-12-28 18:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List
In-Reply-To: <xmqqh8explya.fsf@gitster-ct.c.googlers.com>
On Fri, Dec 28, 2018 at 10:04 AM Junio C Hamano <gitster@pobox.com> wrote:
> Sorry for being slow to recover from the year-end slowness; the 2.20
> release being rather large-ish and needed brown-paper-bag fixes soon
> after it, my temporary trans-pacific migration, or me catching cold
> that I haven't shaken off, did not help X-<.
I hope you feel better soon.
> * en/rebase-merge-on-sequencer (2018-11-08) 2 commits
> - rebase: implement --merge via git-rebase--interactive
> - git-rebase, sequencer: extend --quiet option for the interactive machinery
>
> "git rebase --merge" as been reimplemented by reusing the internal
> machinery used for "git rebase -i".
>
> Expecting a reroll.
> cf. <CABPp-BF8RupyfP69iqAVTXxEhBGyzVd-wUgp3y0pf+CbBFAQeg@mail.gmail.com>
Quick update: Two re-rolls have been sent in[1]; v3 on November 22 and
v4 with only a minor error message tweak on Dec 11. I think I've
addressed all review comments from v2, but neither v3 nor v4 has
received much review -- Dscho was also heavily busy during the run up
to 2.20 and needed some recovery time afterward. I was going to
re-ping in early January. Anyway, it may be worth at least updating
your note to "reroll exists".
Thanks,
Elijah
[1] Latest at https://public-inbox.org/git/20181211161139.31686-1-newren@gmail.com/
^ permalink raw reply
* Re: [PATCH] log: add %S option (like --source) to log --format
From: Junio C Hamano @ 2018-12-28 18:14 UTC (permalink / raw)
To: Derrick Stolee; +Cc: issac.trotts, git, noemi, Issac Trotts
In-Reply-To: <5dfd92d1-2e87-3006-1630-a33794b6066b@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
>> +++ b/Documentation/pretty-formats.txt
>> @@ -134,6 +134,8 @@ The placeholders are:
>> - '%cI': committer date, strict ISO 8601 format
>> - '%d': ref names, like the --decorate option of linkgit:git-log[1]
>> - '%D': ref names without the " (", ")" wrapping.
>> +- '%S': ref name given on the command line by which the commit was reached
>> + (like `git log --source`), only works with `git log`
>
> This "only works with `git log`" made me think about what would happen
> with `git rev-list --pretty=format:"%h %S"` and the answer (on my
> machine) was a segfault.
That's a bad one X-<.
>> + slot = revision_sources_at(c->pretty_ctx->rev->sources, commit);
>> + if (slot && *slot) {
> I'm not sure this check for 'slot' being non-null is necessary, as we
> would already get a failure in the commit-slab code (for
> revision_sources_at()) if the slab is not initialized.
>> + strbuf_addstr(sb, *slot);
>> + return 1;
>> + } else {
>> + die(_("failed to get info for %%S"));
>
> Here, you die() when you fail to get a slot but above you return 0
> when the sources are not initialized.
>
> I don't see another use of die() in this method. Is that the right way
> to handle failure here? (I'm legitimately asking because I have
> over-used 'die()' in the past and am still unclear on when it is
> appropriate.)
This is definitely a bad one, too. If '%d' cannot find decoration,
it would not "die".
Thanks.
^ permalink raw reply
* What's cooking in git.git (Dec 2018, #02; Fri, 28)
From: Junio C Hamano @ 2018-12-28 18:04 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.
The current state is that 'next' has been rewound, a few topics have
been updated, and almost no new topics have been picked up (yet),
even though many of them seem to have been reviewed on-list and I've
also looked at some of them.
Sorry for being slow to recover from the year-end slowness; the 2.20
release being rather large-ish and needed brown-paper-bag fixes soon
after it, my temporary trans-pacific migration, or me catching cold
that I haven't shaken off, did not help X-<.
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
--------------------------------------------------
[Graduated to "master"]
* ds/hash-independent-tests-fix (2018-12-12) 1 commit
+ .gitattributes: ensure t/oid-info/* has eol=lf
Test portability fix.
* jc/run-command-report-exec-failure-fix (2018-12-12) 1 commit
+ run-command: report exec failure
A recent update accidentally squelched an error message when the
run_command API failed to run a missing command, which has been
corrected.
* js/help-commands-verbose-by-default-fix (2018-12-12) 2 commits
+ help -a: handle aliases with long names gracefully
+ help.h: fix coding style
"git help -a" did not work well when an overly long alias is
defined, which has been corrected.
* js/mailinfo-format-flowed-fix (2018-12-13) 1 commit
+ t4256: mark support files as LF-only
Test portability fix.
* nd/show-gitcomp-compilation-fix (2018-12-12) 1 commit
+ parse-options: fix SunCC compiler warning
Portability fix for a recent update to parse-options API.
--------------------------------------------------
[New Topics]
* ds/midx-expire-repack (2018-12-11) 5 commits
- multi-pack-index: implement midx_repack()
- multi-pack-index: prepare 'repack' verb
- multi-pack-index: implement 'expire' verb
- multi-pack-index: refactor permutation logic
- multi-pack-index: prepare for 'expire' verb
* ds/push-sparse-tree-walk (2018-12-11) 6 commits
- pack-objects: create GIT_TEST_PACK_SPARSE
- pack-objects: create pack.useSparse setting
- revision: implement sparse algorithm
- pack-objects: add --sparse option
- list-objects: consume sparse tree walk
- revision: add mark_tree_uninteresting_sparse
* js/rebase-i-redo-exec (2018-12-11) 3 commits
- rebase: introduce a shortcut for --reschedule-failed-exec
- rebase: add a config option to default to --reschedule-failed-exec
- rebase: introduce --reschedule-failed-exec
* md/list-objects-filter-by-depth (2018-12-11) 4 commits
- tree:<depth>: skip some trees even when collecting omits
- list-objects-filter: teach tree:# how to handle >0
- Merge branch 'nd/the-index' into md/list-objects-filter-by-depth
- Merge branch 'sb/more-repo-in-api' into md/list-objects-filter-by-depth
(this branch uses nd/the-index and sb/more-repo-in-api; is tangled with jt/get-reference-with-commit-graph.)
Needs to be rebuilt when sb/more-repo-in-api is rewound.
* nd/backup-log (2018-12-10) 24 commits
- FIXME
- rebase: keep backup of overwritten files on --skip or --abort
- am: keep backup of overwritten files on --skip or --abort
- checkout -f: keep backup of overwritten files
- reset --hard: keep backup of overwritten files
- unpack-trees.c: keep backup of ignored files being overwritten
- refs: keep backup of deleted reflog
- config --edit: support backup log
- sha1-file.c: let index_path() accept NULL istate
- backup-log: keep all blob references around
- gc: prune backup logs
- backup-log: add prune command
- backup-log: add log command
- backup-log: add diff command
- backup-log: add cat command
- backup-log.c: add API for walking backup log
- add--interactive: support backup log
- apply: support backup log with --keep-backup
- commit: support backup log
- update-index: support backup log with --keep-backup
- add: support backup log
- read-cache.c: new flag for add_index_entry() to write to backup log
- backup-log: add "update" subcommand
- doc: introduce new "backup log" concept
* nd/style-opening-brace (2018-12-10) 1 commit
- style: the opening '{' of a function is in a separate line
Code clean-up.
* sg/stress-test (2018-12-10) 8 commits
- fixup! test-lib: add the '--stress' option to run a test repeatedly under load
- test-lib: add the '--stress' option to run a test repeatedly under load
- test-lib-functions: introduce the 'test_set_port' helper function
- test-lib: extract Bash version check for '-x' tracing
- test-lib: set $TRASH_DIRECTORY earlier
- test-lib: consolidate naming of test-results paths
- test-lib: parse some --options earlier
- test-lib: translate SIGTERM and SIGHUP to an exit
* tg/checkout-no-overlay (2018-12-10) 8 commits
- stash: use git checkout --no-overlay
- checkout: allow ignoring unmatched pathspec
- checkout: add --cached option
- checkout: introduce --{,no-}overlay option
- read-cache: add invalidate parameter to remove_marked_cache_entries
- entry: support CE_WT_REMOVE flag in checkout_entry
- entry: factor out unlink_entry function
- move worktree tests to t24*
* jk/proto-v2-hidden-refs-fix (2018-12-14) 3 commits
- upload-pack: support hidden refs with protocol v2
- parse_hide_refs_config: handle NULL section
- serve: pass "config context" through to individual commands
* la/quiltimport-keep-non-patch (2018-12-14) 1 commit
- git-quiltimport: Add --keep-non-patch option
* sb/submodule-fetchjobs-default-to-one (2018-12-14) 1 commit
- submodule update: run at most one fetch job unless otherwise set
--------------------------------------------------
[Stalled]
* lt/date-human (2018-07-09) 1 commit
- Add 'human' date format
A new date format "--date=human" that morphs its output depending
on how far the time is from the current time has been introduced.
"--date=auto" can be used to use this new format when the output is
goint to the pager or to the terminal and otherwise the default
format.
--------------------------------------------------
[Cooking]
* cb/openbsd-allows-reading-directory (2018-12-03) 1 commit
- config.mak.uname: OpenBSD uses BSD semantics with fread for directories
BSD port update.
Will merge to 'next'.
* cb/t5004-empty-tar-archive-fix (2018-12-03) 1 commit
- t5004: avoid using tar for empty packages
BSD port update.
Will merge to 'next'.
* cb/test-lint-cp-a (2018-12-03) 1 commit
- tests: add lint for non portable cp -a
BSD port update.
Will merge to 'next'.
* hb/t0061-dot-in-path-fix (2018-12-03) 1 commit
- t0061: do not fail test if '.' is part of $PATH
Test update.
Will merge to 'next'.
* hn/highlight-sideband-keywords (2018-12-04) 1 commit
- sideband: color lines with keyword only
Lines that begin with a certain keyword that come over the wire, as
well as lines that consist only of one of these keywords, ought to
be painted in color for easier eyeballing, but the latter was
broken ever since the feature was introduced in 2.19, which has
been corrected.
Will merge to 'next'.
* js/commit-graph-chunk-table-fix (2018-12-14) 3 commits
- Makefile: correct example fuzz build
- commit-graph: fix buffer read-overflow
- commit-graph, fuzz: add fuzzer for commit-graph
The codepath to read from the commit-graph file attempted to read
past the end of it when the file's table-of-contents was corrupt.
* jt/get-reference-with-commit-graph (2018-12-06) 1 commit
- revision: use commit graph in get_reference()
(this branch uses sb/more-repo-in-api; is tangled with md/list-objects-filter-by-depth.)
Micro-optimize the code that prepares commit objects to be walked
by "git rev-list" when the commit-graph is available.
Needs to be rebuilt when sb/more-repo-in-api is rewound.
* md/exclude-promisor-objects-fix-cleanup (2018-12-06) 1 commit
- revision.c: put promisor option in specialized struct
Code clean-up.
Will merge to 'next'.
* bw/mailmap (2018-12-09) 1 commit
- mailmap: update brandon williams's email address
Will merge to 'next'.
* do/gitweb-strict-export-conf-doc (2018-12-09) 1 commit
- docs: fix $strict_export text in gitweb.conf.txt
Doc update.
Will merge to 'next'.
* en/directory-renames-nothanks-doc-update (2018-12-09) 1 commit
- git-rebase.txt: update note about directory rename detection and am
Doc update.
Will merge to 'next'.
* fd/gitweb-snapshot-conf-doc-fix (2018-12-09) 1 commit
- docs/gitweb.conf: config variable typo
Doc update.
Will merge to 'next'.
* km/rebase-doc-typofix (2018-12-10) 1 commit
- rebase docs: drop stray word in merge command description
Doc update.
Will merge to 'next'.
* nd/indentation-fix (2018-12-09) 1 commit
- Indent code with TABs
Code cleanup.
Will merge to 'next'.
* tb/use-common-win32-pathfuncs-on-cygwin (2018-12-26) 1 commit
- git clone <url> C:\cygwin\home\USER\repo' is working (again)
Cygwin update.
Will merge to 'next'.
* mk/http-backend-kill-children-before-exit (2018-11-26) 1 commit
(merged to 'next' on 2018-12-28 at 81188d93c3)
+ http-backend: enable cleaning up forked upload/receive-pack on exit
Originally merged to 'next' on 2018-11-29
The http-backend CGI process did not correctly clean up the child
processes it spawns to run upload-pack etc. when it dies itself,
which has been corrected.
Will merge to 'master'.
* tb/log-G-binary (2018-12-26) 1 commit
- log -G: ignore binary files
"git log -G<regex>" looked for a hunk in the "git log -p" patch
output that contained a string that matches the given pattern.
Optimize this code to ignore binary files, which by default will
not show any hunk that would match any pattern (unless textconv or
the --text option is in effect, that is).
Will merge to 'next'.
* dl/merge-cleanup-scissors-fix (2018-11-21) 2 commits
- merge: add scissors line on merge conflict
- t7600: clean up 'merge --squash c3 with c7' test
The list of conflicted paths shown in the editor while concluding a
conflicted merge was shown above the scissors line when the
clean-up mode is set to "scissors", even though it was commented
out just like the list of updated paths and other information to
help the user explain the merge better.
Kicked out of 'next', to replace with a newer iteration.
cf. <cover.1545745331.git.liu.denton@gmail.com>
* aw/pretty-trailers (2018-12-09) 7 commits
- pretty: add support for separator option in %(trailers)
- strbuf: separate callback for strbuf_expand:ing literals
- pretty: add support for "valueonly" option in %(trailers)
- pretty: allow showing specific trailers
- pretty: single return path in %(trailers) handling
- pretty: allow %(trailers) options with explicit value
- doc: group pretty-format.txt placeholders descriptions
The %(trailers) formatter in "git log --format=..." now allows to
optionally pick trailers selectively by keyword, show only values,
etc.
How's the doneness of this one?
* nd/attr-pathspec-in-tree-walk (2018-11-19) 5 commits
- tree-walk: support :(attr) matching
- dir.c: move, rename and export match_attrs()
- pathspec.h: clean up "extern" in function declarations
- tree-walk.c: make tree_entry_interesting() take an index
- tree.c: make read_tree*() take 'struct repository *'
The traversal over tree objects has learned to honor
":(attr:label)" pathspec match, which has been implemented only for
enumerating paths on the filesystem.
Will merge to 'next'.
* ab/commit-graph-progress-fix (2018-11-20) 1 commit
- commit-graph: split up close_reachable() progress output
Will merge to 'next'.
* jn/unknown-index-extensions (2018-11-21) 2 commits
- index: offer advice for unknown index extensions
- index: do not warn about unrecognized extensions
A bit too alarming warning given when unknown index extensions
exist is getting revamped.
Expecting a reroll.
* en/fast-export-import (2018-11-17) 11 commits
(merged to 'next' on 2018-12-28 at a1b09cf515)
+ fast-export: add a --show-original-ids option to show original names
+ fast-import: remove unmaintained duplicate documentation
+ fast-export: add --reference-excluded-parents option
+ fast-export: ensure we export requested refs
+ fast-export: when using paths, avoid corrupt stream with non-existent mark
+ fast-export: move commit rewriting logic into a function for reuse
+ fast-export: avoid dying when filtering by paths and old tags exist
+ fast-export: use value from correct enum
+ git-fast-export.txt: clarify misleading documentation about rev-list args
+ git-fast-import.txt: fix documentation for --quiet option
+ fast-export: convert sha1 to oid
Originally merged to 'next' on 2018-11-18
Small fixes and features for fast-export and fast-import, mostly on
the fast-export side.
Will merge to 'master'.
* nd/checkout-dwim-fix (2018-11-14) 1 commit
(merged to 'next' on 2018-12-28 at 3183c9305b)
+ checkout: disambiguate dwim tracking branches and local files
Originally merged to 'next' on 2018-11-18
"git checkout frotz" (without any double-dash) avoids ambiguity by
making sure 'frotz' cannot be interpreted as a revision and as a
path at the same time. This safety has been updated to check also
a unique remote-tracking branch 'frotz' in a remote, when dwimming
to create a local branch 'frotz' out of a remote-tracking branch
'frotz' from a remote.
Will merge to 'master'.
* nd/checkout-noisy (2018-11-20) 2 commits
- t0027: squelch checkout path run outside test_expect_* block
- checkout: print something when checking out paths
"git checkout [<tree-ish>] path..." learned to report the number of
paths that have been checked out of the index or the tree-ish,
which gives it the same degree of noisy-ness as the case in which
the command checks out a branch.
Will merge to 'next'.
* sg/clone-initial-fetch-configuration (2018-11-16) 3 commits
(merged to 'next' on 2018-12-28 at 82e104f221)
+ Documentation/clone: document ignored configuration variables
+ clone: respect additional configured fetch refspecs during initial fetch
+ clone: use a more appropriate variable name for the default refspec
Originally merged to 'next' on 2018-11-18
Refspecs configured with "git -c var=val clone" did not propagate
to the resulting repository, which has been corrected.
Will merge to 'master'.
* en/rebase-merge-on-sequencer (2018-11-08) 2 commits
- rebase: implement --merge via git-rebase--interactive
- git-rebase, sequencer: extend --quiet option for the interactive machinery
"git rebase --merge" as been reimplemented by reusing the internal
machinery used for "git rebase -i".
Expecting a reroll.
cf. <CABPp-BF8RupyfP69iqAVTXxEhBGyzVd-wUgp3y0pf+CbBFAQeg@mail.gmail.com>
* fc/http-version (2018-11-09) 1 commit
(merged to 'next' on 2018-12-28 at 56bcbb0fa9)
+ http: add support selecting http version
Originally merged to 'next' on 2018-11-18
The "http.version" configuration variable can be used with recent
enough cURL library to force the version of HTTP used to talk when
fetching and pushing.
Will merge to 'master'.
* dl/remote-save-to-push (2018-12-11) 1 commit
- remote: add --save-to-push option to git remote set-url
"git remote set-url" learned a new option that moves existing value
of the URL field to pushURL field of the remote before replacing
the URL field with a new value.
I am personally not yet quite convinced if this is worth pursuing.
* jk/loose-object-cache (2018-11-24) 10 commits
(merged to 'next' on 2018-12-28 at 5a5faf384e)
+ odb_load_loose_cache: fix strbuf leak
+ fetch-pack: drop custom loose object cache
+ sha1-file: use loose object cache for quick existence check
+ object-store: provide helpers for loose_objects_cache
+ sha1-file: use an object_directory for the main object dir
+ handle alternates paths the same as the main object dir
+ sha1_file_name(): overwrite buffer instead of appending
+ rename "alternate_object_database" to "object_directory"
+ submodule--helper: prefer strip_suffix() to ends_with()
+ fsck: do not reuse child_process structs
Originally merged to 'next' on 2018-11-24
Code clean-up with optimization for the codepath that checks
(non-)existence of loose objects.
Will merge to 'master'.
* js/protocol-advertise-multi (2018-11-17) 1 commit
- protocol: advertise multiple supported versions
The transport layer has been updated so that the protocol version
used can be negotiated between the parties, by the initiator
listing the protocol versions it is willing to talk, and the other
side choosing from one of them.
Expecting a reroll.
cf. <20181218230514.GH37614@google.com>
* js/smart-http-detect-remote-error (2018-12-12) 4 commits
- lib-httpd, t5551: check server-side HTTP errors
- remote-curl: tighten "version 2" check for smart-http
- remote-curl: refactor smart-http discovery
- pack-protocol.txt: accept error packets in any context
Some errors from the other side coming over smart HTTP transport
were not noticed, which has been corrected.
Will merge to 'next'.
* nb/branch-show-other-worktrees-head (2018-11-12) 2 commits
- branch: mark and colorize a branch differently if it is checked out in a linked worktree
- ref-filter: add worktree atom
"git branch --list" learned to show branches that are checked out
in other worktrees connected to the same repository prefixed with
'+', similar to the way the currently checked out branch is shown
with '*' in front.
Expecting a reroll.
* nd/the-index (2018-11-12) 22 commits
(merged to 'next' on 2018-12-28 at 6bbd3befbe)
+ rebase-interactive.c: remove the_repository references
+ rerere.c: remove the_repository references
+ pack-*.c: remove the_repository references
+ pack-check.c: remove the_repository references
+ notes-cache.c: remove the_repository references
+ line-log.c: remove the_repository reference
+ diff-lib.c: remove the_repository references
+ delta-islands.c: remove the_repository references
+ cache-tree.c: remove the_repository references
+ bundle.c: remove the_repository references
+ branch.c: remove the_repository reference
+ bisect.c: remove the_repository reference
+ blame.c: remove implicit dependency the_repository
+ sequencer.c: remove implicit dependency on the_repository
+ sequencer.c: remove implicit dependency on the_index
+ transport.c: remove implicit dependency on the_index
+ notes-merge.c: remove implicit dependency the_repository
+ notes-merge.c: remove implicit dependency on the_index
+ list-objects.c: reduce the_repository references
+ list-objects-filter.c: remove implicit dependency on the_index
+ wt-status.c: remove implicit dependency the_repository
+ wt-status.c: remove implicit dependency on the_index
(this branch is used by md/list-objects-filter-by-depth.)
Originally merged to 'next' on 2018-11-18
More codepaths become aware of working with in-core repository
instance other than the default "the_repository".
Will merge to 'master'.
* ot/ref-filter-object-info (2018-11-24) 6 commits
- ref-filter: replace unportable `%lld` format with %PRIdMAX
- ref-filter: add docs for new options
- ref-filter: add tests for deltabase
- ref-filter: add deltabase option
- ref-filter: add tests for objectsize:disk
- ref-filter: add objectsize:disk option
The "--format=<placeholder>" option of for-each-ref, branch and tag
learned to show a few more traits of objects that can be learned by
the object_info API.
Kicked out of 'next'; will replace with a reroll.
cf. <01020167e063687c-37a43a09-0a5f-4335-8c21-ec15a0a67882-000000@eu-west-1.amazonses.com>
* sb/diff-color-moved-config-option-fixup (2018-11-14) 1 commit
- diff: align move detection error handling with other options
Minor inconsistency fix.
Will merge to 'next'.
* ab/push-dwim-dst (2018-11-14) 7 commits
(merged to 'next' on 2018-12-28 at d9f618de10)
+ push doc: document the DWYM behavior pushing to unqualified <dst>
+ push: test that <src> doesn't DWYM if <dst> is unqualified
+ push: add an advice on unqualified <dst> push
+ push: move unqualified refname error into a function
+ push: improve the error shown on unqualified <dst> push
+ i18n: remote.c: mark error(...) messages for translation
+ remote.c: add braces in anticipation of a follow-up change
Originally merged to 'next' on 2018-11-18
"git push $there $src:$dst" rejects when $dst is not a fully
qualified refname and not clear what the end user meant. The
codepath has been taught to give a clearer error message, and also
guess where the push should go by taking the type of the pushed
object into account (e.g. a tag object would want to go under
refs/tags/).
Will merge to 'master'.
* md/list-lazy-objects-fix (2018-12-06) 1 commit
- list-objects.c: don't segfault for missing cmdline objects
"git rev-list --exclude-promissor-objects" had to take an object
that does not exist locally (and is lazily available) from the
command line without barfing, but the code dereferenced NULL.
Will merge to 'next'.
* nd/i18n (2018-11-12) 16 commits
(merged to 'next' on 2018-12-28 at 8e2de8338e)
+ fsck: mark strings for translation
+ fsck: reduce word legos to help i18n
+ parse-options.c: mark more strings for translation
+ parse-options.c: turn some die() to BUG()
+ parse-options: replace opterror() with optname()
+ repack: mark more strings for translation
+ remote.c: mark messages for translation
+ remote.c: turn some error() or die() to BUG()
+ reflog: mark strings for translation
+ read-cache.c: add missing colon separators
+ read-cache.c: mark more strings for translation
+ read-cache.c: turn die("internal error") to BUG()
+ attr.c: mark more string for translation
+ archive.c: mark more strings for translation
+ alias.c: mark split_cmdline_strerror() strings for translation
+ git.c: mark more strings for translation
Originally merged to 'next' on 2018-11-18
More _("i18n") markings.
Will merge to 'master'.
* sb/more-repo-in-api (2018-11-14) 23 commits
- t/helper/test-repository: celebrate independence from the_repository
- path.h: make REPO_GIT_PATH_FUNC repository agnostic
- commit: prepare free_commit_buffer and release_commit_memory for any repo
- commit-graph: convert remaining functions to handle any repo
- submodule: don't add submodule as odb for push
- submodule: use submodule repos for object lookup
- pretty: prepare format_commit_message to handle arbitrary repositories
- commit: prepare logmsg_reencode to handle arbitrary repositories
- commit: prepare repo_unuse_commit_buffer to handle any repo
- commit: prepare get_commit_buffer to handle any repo
- commit-reach: prepare in_merge_bases[_many] to handle any repo
- commit-reach: prepare get_merge_bases to handle any repo
- commit-reach.c: allow get_merge_bases_many_0 to handle any repo
- commit-reach.c: allow remove_redundant to handle any repo
- commit-reach.c: allow merge_bases_many to handle any repo
- commit-reach.c: allow paint_down_to_common to handle any repo
- commit: allow parse_commit* to handle any repo
- object: parse_object to honor its repository argument
- object-store: prepare has_{sha1, object}_file to handle any repo
- object-store: prepare read_object_file to deal with any repo
- object-store: allow read_object_file_extended to read from any repo
- packfile: allow has_packed_and_bad to handle arbitrary repositories
- sha1_file: allow read_object to read objects in arbitrary repositories
(this branch is used by jt/get-reference-with-commit-graph and md/list-objects-filter-by-depth.)
Originally merged to 'next' on 2018-11-19
The in-core repository instances are passed through more codepaths.
Kicked out of 'next'; will replace with a reroll.
cf. <20181215000942.46033-2-sbeller@google.com>
* en/merge-path-collision (2018-12-01) 11 commits
(merged to 'next' on 2018-12-28 at b50d3eee25)
+ t6036: avoid non-portable "cp -a"
+ merge-recursive: combine error handling
+ t6036, t6043: increase code coverage for file collision handling
+ merge-recursive: improve rename/rename(1to2)/add[/add] handling
+ merge-recursive: use handle_file_collision for add/add conflicts
+ merge-recursive: improve handling for rename/rename(2to1) conflicts
+ merge-recursive: fix rename/add conflict handling
+ merge-recursive: new function for better colliding conflict resolutions
+ merge-recursive: increase marker length with depth of recursion
+ t6036, t6042: testcases for rename collision of already conflicting files
+ t6042: add tests for consistency in file collision conflict handling
Originally merged to 'next' on 2018-12-01
Updates for corner cases in merge-recursive.
Will merge to 'master'.
* sd/stash-wo-user-name (2018-11-19) 1 commit
(merged to 'next' on 2018-12-28 at 99197ef5a1)
+ stash: tolerate missing user identity
Originally merged to 'next' on 2018-11-19
A properly configured username/email is required under
user.useConfigOnly in order to create commits; now "git stash"
(even though it creates commit objects to represent stash entries)
command is excempt from the requirement.
Will merge to 'master'.
* bc/sha-256 (2018-11-14) 12 commits
- hash: add an SHA-256 implementation using OpenSSL
- sha256: add an SHA-256 implementation using libgcrypt
- Add a base implementation of SHA-256 support
- commit-graph: convert to using the_hash_algo
- t/helper: add a test helper to compute hash speed
- sha1-file: add a constant for hash block size
- t: make the sha1 test-tool helper generic
- t: add basic tests for our SHA-1 implementation
- cache: make hashcmp and hasheq work with larger hashes
- hex: introduce functions to print arbitrary hashes
- sha1-file: provide functions to look up hash algorithms
- sha1-file: rename algorithm to "sha1"
Add sha-256 hash and plug it through the code to allow building Git
with the "NewHash".
* js/vsts-ci (2018-10-16) 13 commits
. travis: fix skipping tagged releases
. README: add a build badge (status of the Azure Pipelines build)
. tests: record more stderr with --write-junit-xml in case of failure
. tests: include detailed trace logs with --write-junit-xml upon failure
. git-p4: use `test_atexit` to kill the daemon
. git-daemon: use `test_atexit` in the tests
. tests: introduce `test_atexit`
. ci: add a build definition for Azure DevOps
. ci/lib.sh: add support for Azure Pipelines
. tests: optionally write results as JUnit-style .xml
. test-date: add a subcommand to measure times in shell scripts
. ci/lib.sh: encapsulate Travis-specific things
. ci: rename the library of common functions
Prepare to run test suite on Azure DevOps.
Ejected out of 'pu', as doing so seems to help other topics get
tested at TravisCI.
https://travis-ci.org/git/git/builds/452713184 is a sample of a
build whose tests on 4 hang (with this series in). Ejecting it
gave us https://travis-ci.org/git/git/builds/452778963 which still
shows breakages from other topics not yet in 'next', but at least
the tests do not stall.
* du/branch-show-current (2018-10-26) 1 commit
- branch: introduce --show-current display option
"git branch" learned a new subcommand "--show-current".
I am personally not yet quite convinced if this is worth pursuing.
* mk/use-size-t-in-zlib (2018-10-15) 1 commit
- zlib.c: use size_t for size
The wrapper to call into zlib followed our long tradition to use
"unsigned long" for sizes of regions in memory, which have been
updated to use "size_t".
* ag/sequencer-reduce-rewriting-todo (2018-11-12) 16 commits
. rebase--interactive: move transform_todo_file() to rebase--interactive.c
. sequencer: fix a call to error() in transform_todo_file()
. sequencer: use edit_todo_list() in complete_action()
. rebase-interactive: rewrite edit_todo_list() to handle the initial edit
. rebase-interactive: append_todo_help() changes
. rebase-interactive: use todo_list_write_to_file() in edit_todo_list()
. sequencer: refactor skip_unnecessary_picks() to work on a todo_list
. sequencer: change complete_action() to use the refactored functions
. sequencer: make sequencer_make_script() write its script to a strbuf
. sequencer: refactor rearrange_squash() to work on a todo_list
. sequencer: refactor sequencer_add_exec_commands() to work on a todo_list
. sequencer: refactor check_todo_list() to work on a todo_list
. sequencer: introduce todo_list_write_to_file()
. sequencer: refactor transform_todos() to work on a todo_list
. sequencer: make the todo_list structure public
. sequencer: changes in parse_insn_buffer()
The scripted version of "git rebase -i" wrote and rewrote the todo
list many times during a single step of its operation, and the
recent C-rewrite made a faithful conversion of the logic to C. The
implementation has been updated to carry necessary information
around in-core to avoid rewriting the same file over and over
unnecessarily.
With too many topics in-flight that touch sequencer and rebaser,
this need to wait giving precedence to other topics that fix bugs.
* sb/submodule-recursive-fetch-gets-the-tip (2018-12-09) 9 commits
- fetch: ensure submodule objects fetched
- submodule.c: fetch in submodules git directory instead of in worktree
- submodule: migrate get_next_submodule to use repository structs
- repository: repo_submodule_init to take a submodule struct
- submodule: store OIDs in changed_submodule_names
- submodule.c: tighten scope of changed_submodule_names struct
- submodule.c: sort changed_submodule_names before searching it
- submodule.c: fix indentation
- sha1-array: provide oid_array_filter
"git fetch --recurse-submodules" may not fetch the necessary commit
that is bound to the superproject, which is getting corrected.
Ready?
* js/add-i-coalesce-after-editing-hunk (2018-08-28) 1 commit
- add -p: coalesce hunks before testing applicability
Applicability check after a patch is edited in a "git add -i/p"
session has been improved.
Will hold.
cf. <e5b2900a-0558-d3bf-8ea1-d526b078bbc2@talktalk.net>
* ps/stash-in-c (2018-11-26) 22 commits
. stash: replace all `write-tree` child processes with API calls
. stash: optimize `get_untracked_files()` and `check_changes()`
. stash: convert `stash--helper.c` into `stash.c`
. stash: convert save to builtin
. stash: make push -q quiet
. stash: convert push to builtin
. stash: convert create to builtin
. stash: convert store to builtin
. stash: convert show to builtin
. stash: convert list to builtin
. stash: convert pop to builtin
. stash: convert branch to builtin
. stash: convert drop and clear to builtin
. stash: convert apply to builtin
. stash: mention options in `show` synopsis
. stash: add tests for `git stash show` config
. stash: rename test cases to be more descriptive
. t3903: modernize style
. stash: improve option parsing test coverage
. strbuf.c: add `strbuf_insertf()` and `strbuf_vinsertf()`
. strbuf.c: add `strbuf_join_argv()`
. sha1-name.c: add `get_oidf()` which acts like `get_oid()`
"git stash" rewritten in C.
Expecting a reroll, probably on top of the sd/stash-wo-user-name
topic after it stabilizes, with an escape hatch like the one in
"rebase in C".
* pw/add-p-select (2018-07-26) 4 commits
- add -p: optimize line selection for short hunks
- add -p: allow line selection to be inverted
- add -p: select modified lines correctly
- add -p: select individual hunk lines
"git add -p" interactive interface learned to let users choose
individual added/removed lines to be used in the operation, instead
of accepting or rejecting a whole hunk.
Will discard.
No further feedbacks on the topic for quite some time.
cf. <d622a95b-7302-43d4-4ec9-b2cf3388c653@talktalk.net>
I found the feature to be hard to explain, and may result in more
end-user complaints, but let's see.
--------------------------------------------------
[Discarded]
* ab/reject-alias-loop (2018-10-19) 1 commit
. alias: detect loops in mixed execution mode
Two (or more) aliases that mutually refer to each other can form an
infinite loop; we now attempt to notice and stop.
Discarded.
Reverted out of 'next'.
cf. <87sh0slvxm.fsf@evledraar.gmail.com>
* gl/bundle-unlock-before-aborting (2018-11-14) 1 commit
. bundle: rollback lock file while refusing to create an empty bundle
Superseded by jk/close-duped-fd-before-unlock-for-bundle
* js/remote-archive-v2 (2018-09-28) 4 commits
. archive: allow archive over HTTP(S) with proto v2
. archive: implement protocol v2 archive command
. archive: use packet_reader for communications
. archive: follow test standards around assertions
The original implementation of "git archive --remote" more or less
bypassed the transport layer and did not work over http(s). The
version 2 of the protocol is defined to allow going over http(s) as
well as Git native transport.
Retracted; reverted out of next.
cf. <20181114195142.GI126896@google.com>
* ab/format-patch-rangediff-not-stat (2018-11-24) 1 commit
. format-patch: don't include --stat with --range-diff output
The "--rangediff" option recently added to "format-patch"
interspersed a bogus and useless "--stat" information by mistake,
which is being corrected.
Reverted out of 'next'.
* jc/postpone-rebase-in-c (2018-11-26) 1 commit
. rebase: mark the C reimplementation as an experimental opt-in feature
People seem to be still finding latent bugs in the "rebase in C"
reimplementation. For the upcoming release, use the scripted
version by default and adjust the documentation accordingly.
Reverted out of 'next'.
^ permalink raw reply
* Re: RFE: version-controlled merge rules
From: Duy Nguyen @ 2018-12-28 16:03 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Jonathan Nieder, Git Mailing List
In-Reply-To: <95ca8579-4e12-1e46-8824-b1d19c6d9289@zytor.com>
On Fri, Dec 28, 2018 at 4:46 PM H. Peter Anvin <hpa@zytor.com> wrote:
>
> On 12/27/18 3:55 PM, Jonathan Nieder wrote:
> > Hi,
> >
> > H. Peter Anvin wrote:
> >
> >> [merge "version"]
> >> name = Version file merge driver
> >> driver = sort -V -r %O %A %B | head -1 > %A.tmp.1 && mv -f %A.tmp.1 %A
> > [...]
> >> However, I can't even put this in .gitattributes, because doing so would break
> >> any user who *doesn't* have the previous rule defined locally. Even worse, if
> >> this rule needs to change, propagating it to all new users has to be done
> >> manually... never mind if it needs to vary by branch!
> >>
> >> The simplest way to address this would presumably be to let the
> >> repository/working directory contain a .gitconfig file that can contain rules
> >> like that. (Allowing it to be in the repository proper is probably a
> >> requirement for merges to be handled correctly on bare repositories; I'm not
> >> sure how .gitattributes is handled for that.)
> >
> > The main issue I see is that this would make it a little *too* easy to
> > run arbitrary code on the user's machine. Build systems often already
> > lead to that, but users are more familiar with the risks for build
> > than for version control.
> >
> > See [1] for some related discussion.
> >
> > That said, using the include.path feature (see git-config(1)), it's
> > possible to do something similar:
> >
> > [include]
> > path = ../.gitconfig
> >
> > Thanks and hope that helps,
> > Jonathan
> >
>
> That would be great, except that it doesn't work if the worktree isn't in
> "..". This is one of many cases where it would be great to have environment
> variable interpolation.
It's been discussed, see [1] and others in the same thread. The
feeling I got was it seemed good idea, but we're just not sure about
the exact syntax and some corner cases, and most importantly nobody
has stepped up to implement it.
[1] https://public-inbox.org/git/20181109101918.GC7410@sigill.intra.peff.net/
--
Duy
^ permalink raw reply
* Re: Can git choose perl at runtime?
From: John Passaro @ 2018-12-28 15:38 UTC (permalink / raw)
To: brian m. carlson, Ævar Arnfjörð Bjarmason,
John Passaro, git, Jonathan Nieder
In-Reply-To: <20181224022042.GE26554@genre.crustytoothpaste.net>
On Sun, Dec 23, 2018 at 9:20 PM brian m. carlson
<sandals@crustytoothpaste.net> wrote:
>
> I think we should just ask Homebrew to ship a functional, complete Git.
They are doing just that:
https://github.com/Homebrew/homebrew-core/pull/35446
If for some reason this patch doesn't make it in, I'll keep bugging
them about it, but this does seem like the preferable solution.
Thank you everybody for chiming in.
^ permalink raw reply
* Re: RFE: version-controlled merge rules
From: Junio C Hamano @ 2018-12-28 14:35 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: H. Peter Anvin, git
In-Reply-To: <20181227235526.GF146609@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
> The main issue I see is that this would make it a little *too* easy to
> run arbitrary code on the user's machine. Build systems often already
> lead to that, but users are more familiar with the risks for build
> than for version control.
>
> See [1] for some related discussion.
>
> That said, using the include.path feature (see git-config(1)), it's
> possible to do something similar:
>
> [include]
> path = ../.gitconfig
>
> Thanks and hope that helps,
The issue the arrangement to specify what kind of files they are in
the attribute system and to specify what exact commands to be run in
the configuration addresses is twofold. The security issue is one
and poking a hole with include.path mechanism is probably OK as
there is end-user consent, but I tend to agree that a similar risk
already exists by a project shipping Makefile et al.
There is the other side of the issue.
The arrangement allows project not to be monoculture by leaving the
exact command sequence to use on the kind of files (specified by the
project with the attribute system) up to the end-user in their
configuration. While Peter may feel that sort piped to head may be
available on all the reasonable UNIX systems, his merge driver would
not work on other platforms. There already is a similar reliance of
monoculture by a project shipping Makefile et al, which is an
interesting parallel.
^ permalink raw reply
* Re: Bug in git-remote
From: SZEDER Gábor @ 2018-12-28 12:32 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Gennady Uraltsev, git
In-Reply-To: <nycvar.QRO.7.76.6.1812171347530.43@tvgsbejvaqbjf.bet>
On Mon, Dec 17, 2018 at 01:50:56PM +0100, Johannes Schindelin wrote:
> Hi Gábor,
>
> On Sat, 15 Dec 2018, SZEDER Gábor wrote:
>
> > On Sat, Dec 15, 2018 at 02:14:56AM -0500, Gennady Uraltsev wrote:
> > > I am on git version 2.20.0
> > >
> > > $ git remote
> > >
> > > does not show remotes configured in named files in $GIT_DIR/remotes/
> > >
> > > I do not think that this is the intended behavior.
> >
> > It's a known bug. When 'git remote' was rewritten as a builtin
> > command in C in commit 211c89682e (Make git-remote a builtin,
> > 2008-02-29) the parts dealing with remotes under 'GIT_DIR/remotes/'
> > were not rewritten. I don't know whether that was intended or not,
> > but storing remote information as configuration was about two years
> > old back then. Given that since then '$GIT_DIR/remotes/' got marked
> > as "This mechanism is legacy and not likely to be found in modern
> > repositories", I'm not sure it's worth fixing. Perhaps it's time for
> > calling it deprecated.
>
> I would be in favor of deprecating it, and then removing it.
>
> However, when I tried a similar thing with the completely obsolete
> `$GIT_DIR/branches/` feature, it was shot down IIRC on the mere suspicion
> that there was a single remaining user among the Linux kernel lieutenants.
>
> And I fear that the suspected workflow of that lieutenant involved having
> those legacy remotes, too.
>
> Hopefully this issue will be resolved somehow, as it is not exactly a
> splendid idea to keep a legacy feature of a software used by millions,
> just for a single user, I would think.
Well, even if we don't remove support for '$GIT_DIR/remotes/', we
could still mark it as deprecated in the documentation, so hopefully
it won't gain any new users, and users won't waste time digging and
writing bugreports like this.
When, if at all, and how we'll progress beyond that is a separate
question.
Gábor
^ permalink raw reply
* Re: [PATCH 0/2] Improve documentation on UTF-16
From: Johannes Sixt @ 2018-12-28 8:59 UTC (permalink / raw)
To: brian m. carlson; +Cc: git, Lars Schneider, Torsten Bögershausen
In-Reply-To: <20181227234535.GD423984@genre.crustytoothpaste.net>
Am 28.12.18 um 00:45 schrieb brian m. carlson:
> On Thu, Dec 27, 2018 at 08:55:27PM +0100, Johannes Sixt wrote:
>> But why do you add another U+FEFF on the way to UTF-8? There is one in the
>> incoming UTF-16 data, and only *that* one must be converted. If there is no
>> U+FEFF in the UTF-16 data, the should not be one in UTF-8, either.
>> Puzzled...
>
> So for UTF-16, there must be a BOM. For UTF-16LE and UTF-16BE, there
> must not be a BOM. So if we do this:
>
> $ printf '\xfe\xff\x00\x0a' | iconv -f UTF-16BE -t UTF-16 | xxd -g1
> 00000000: ff fe ff fe 0a 00 ......
What sort of braindamage is this? Fix iconv.
But as I said, I'm not an expert. I just vented my worries that
widespread existing practice would be ignored under the excuse "you are
the outlier".
-- Hannes
^ permalink raw reply
* Re: [PATCH 0/2] Improve documentation on UTF-16
From: Ævar Arnfjörð Bjarmason @ 2018-12-28 8:46 UTC (permalink / raw)
To: brian m. carlson; +Cc: git, Lars Schneider, Torsten Bögershausen
In-Reply-To: <20181227021734.528629-1-sandals@crustytoothpaste.net>
On Thu, Dec 27 2018, brian m. carlson wrote:
> We've recently fielded several reports from unhappy Windows users about
> our handling of UTF-16, UTF-16LE, and UTF-16BE, none of which seem to be
> suitable for certain Windows programs.
Just for context, is "we" here $DAYJOB or a reference to some previous
ML thread(s) on this list, or something else?
^ permalink raw reply
* Re: RFE: version-controlled merge rules
From: Ævar Arnfjörð Bjarmason @ 2018-12-28 8:42 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: git
In-Reply-To: <ad875f1e-54e1-e19f-cd65-95ab503c6de2@zytor.com>
On Thu, Dec 27 2018, H. Peter Anvin wrote:
> Right now, merge rules can get selected in .gitattributes, which is
> version-controlled. However, there does not appear to be any way to *define*
> custom merge rules which is version controlled.
>
> There are a lot of different files which can benefit from custom merge rules,
> especially ones that are in some ways cumulative or version/tree-dependent.
> For example, I use this rule to merge version files:
>
> [merge "version"]
> name = Version file merge driver
> driver = sort -V -r %O %A %B | head -1 > %A.tmp.1 && mv -f %A.tmp.1 %A
>
> (Incidentally: the need for an explicit temp file here is frustrating. It
> would be better if git could manage the temporary file. Overwriting %A
> directly truncates the file too early. See other email.)
>
> However, I can't even put this in .gitattributes, because doing so would break
> any user who *doesn't* have the previous rule defined locally. Even worse, if
> this rule needs to change, propagating it to all new users has to be done
> manually... never mind if it needs to vary by branch!
>
> The simplest way to address this would presumably be to let the
> repository/working directory contain a .gitconfig file that can contain rules
> like that. (Allowing it to be in the repository proper is probably a
> requirement for merges to be handled correctly on bare repositories; I'm not
> sure how .gitattributes is handled for that.)
This would fall under the general umbrella of allowing repos to set
configuration, see
https://public-inbox.org/git/?q=87zi6eakkt.fsf%40evledraar.gmail.com for
some previous discussion.
^ permalink raw reply
* Re: RFE: version-controlled merge rules
From: H. Peter Anvin @ 2018-12-28 4:48 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git
In-Reply-To: <20181227235526.GF146609@google.com>
On 12/27/18 3:55 PM, Jonathan Nieder wrote:
> Hi,
>
> H. Peter Anvin wrote:
>
>> [merge "version"]
>> name = Version file merge driver
>> driver = sort -V -r %O %A %B | head -1 > %A.tmp.1 && mv -f %A.tmp.1 %A
> [...]
>> However, I can't even put this in .gitattributes, because doing so would break
>> any user who *doesn't* have the previous rule defined locally. Even worse, if
>> this rule needs to change, propagating it to all new users has to be done
>> manually... never mind if it needs to vary by branch!
>>
>> The simplest way to address this would presumably be to let the
>> repository/working directory contain a .gitconfig file that can contain rules
>> like that. (Allowing it to be in the repository proper is probably a
>> requirement for merges to be handled correctly on bare repositories; I'm not
>> sure how .gitattributes is handled for that.)
>
> The main issue I see is that this would make it a little *too* easy to
> run arbitrary code on the user's machine. Build systems often already
> lead to that, but users are more familiar with the risks for build
> than for version control.
>
> See [1] for some related discussion.
>
> That said, using the include.path feature (see git-config(1)), it's
> possible to do something similar:
>
> [include]
> path = ../.gitconfig
>
> Thanks and hope that helps,
> Jonathan
>
That would be great, except that it doesn't work if the worktree isn't in
"..". This is one of many cases where it would be great to have environment
variable interpolation.
-hpa
^ permalink raw reply
* [PATCH 2/2] Unset CURLOPT_FAILONERROR
From: Masaya Suzuki @ 2018-12-28 1:47 UTC (permalink / raw)
To: git; +Cc: peff, jrnieder, Masaya Suzuki
In-Reply-To: <20181228014720.206443-1-masayasuzuki@google.com>
When GIT_CURL_VERBOSE is set, libcurl produces request/response headers
to stderr. However, if the response is an error response and
CURLOPT_FAILONERROR is set, libcurl stops parsing the response, and it
won't ump the headers. Showing HTTP response headers is useful for
debugging, especially for non-OK responses.
This is substantially same as setting http_options.keep_error to all
requests. Hence, removing this option.
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
---
http.c | 4 ----
http.h | 1 -
remote-curl.c | 1 -
t/lib-httpd/apache.conf | 1 +
t/t5581-http-curl-verbose.sh | 32 ++++++++++++++++++++++++++++++++
5 files changed, 33 insertions(+), 6 deletions(-)
create mode 100755 t/t5581-http-curl-verbose.sh
diff --git a/http.c b/http.c
index d23417670..8f8101da3 100644
--- a/http.c
+++ b/http.c
@@ -1269,7 +1269,6 @@ struct active_request_slot *get_active_slot(void)
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, NULL);
curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 0);
curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);
- curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(slot->curl, CURLOPT_RANGE, NULL);
/*
@@ -1848,8 +1847,6 @@ static int http_request(const char *url,
strbuf_addstr(&buf, "Pragma:");
if (options && options->no_cache)
strbuf_addstr(&buf, " no-cache");
- if (options && options->keep_error)
- curl_easy_setopt(slot->curl, CURLOPT_FAILONERROR, 0);
if (options && options->initial_request &&
http_follow_config == HTTP_FOLLOW_INITIAL)
curl_easy_setopt(slot->curl, CURLOPT_FOLLOWLOCATION, 1);
@@ -2415,7 +2412,6 @@ struct http_object_request *new_http_object_request(const char *base_url,
freq->slot = get_active_slot();
curl_easy_setopt(freq->slot->curl, CURLOPT_FILE, freq);
- curl_easy_setopt(freq->slot->curl, CURLOPT_FAILONERROR, 0);
curl_easy_setopt(freq->slot->curl, CURLOPT_WRITEFUNCTION, fwrite_sha1_file);
curl_easy_setopt(freq->slot->curl, CURLOPT_ERRORBUFFER, freq->errorstr);
curl_easy_setopt(freq->slot->curl, CURLOPT_URL, freq->url);
diff --git a/http.h b/http.h
index d305ca1dc..eebf40688 100644
--- a/http.h
+++ b/http.h
@@ -146,7 +146,6 @@ extern char *get_remote_object_url(const char *url, const char *hex,
/* Options for http_get_*() */
struct http_get_options {
unsigned no_cache:1,
- keep_error:1,
initial_request:1;
/* If non-NULL, returns the content-type of the response. */
diff --git a/remote-curl.c b/remote-curl.c
index 48656bf18..43e7a1d80 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -380,7 +380,6 @@ static struct discovery *discover_refs(const char *service, int for_push)
http_options.extra_headers = &extra_headers;
http_options.initial_request = 1;
http_options.no_cache = 1;
- http_options.keep_error = 1;
http_ret = http_get_strbuf(refs_url.buf, &buffer, &http_options);
switch (http_ret) {
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 581c010d8..cc4b87507 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -115,6 +115,7 @@ Alias /auth/dumb/ www/auth/dumb/
SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
SetEnv GIT_HTTP_EXPORT_ALL
</LocationMatch>
+ScriptAliasMatch /error_git_upload_pack/(.*)/git-upload-pack error.sh/
ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1
ScriptAlias /broken_smart/ broken-smart-http.sh/
ScriptAlias /error/ error.sh/
diff --git a/t/t5581-http-curl-verbose.sh b/t/t5581-http-curl-verbose.sh
new file mode 100755
index 000000000..c89e06e12
--- /dev/null
+++ b/t/t5581-http-curl-verbose.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+test_description='test GIT_CURL_VERBOSE'
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-httpd.sh
+start_httpd
+
+test_expect_success 'setup repository' '
+ git config push.default matching &&
+ echo content >file &&
+ git add file &&
+ git commit -m one
+'
+
+test_expect_success 'create http-accessible bare repository' '
+ mkdir "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ (cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ git --bare init
+ ) &&
+ git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ git push public master:master
+'
+
+test_expect_success 'failure in git-upload-pack is shown' '
+ (GIT_CURL_VERBOSE=1 git clone --bare "$HTTPD_URL/error_git_upload_pack/smart/repo.git" 2>curl_log ||
+ true) &&
+ cat curl_log | grep "< HTTP/1.1 500 Intentional Breakage"
+'
+
+stop_httpd
+
+test_done
--
2.20.1.415.g653613c723-goog
^ permalink raw reply related
* [PATCH 1/2] Change how HTTP response body is returned
From: Masaya Suzuki @ 2018-12-28 1:47 UTC (permalink / raw)
To: git; +Cc: peff, jrnieder, Masaya Suzuki
This changes the way HTTP response body is returned in
http_request_reauth and post_rpc.
1. http_request_reauth makes up to two requests; one without a
credential and one with a credential. The first request can fail if
it needs a credential. When the keep_error option is specified, the
response to the first request can be written to the HTTP response
body destination. If the response body destination is a string
buffer, it erases the buffer before making the second request. By
introducing http_response_dest, it can handle the case that the
destination is a file handle.
2. post_rpc makes an HTTP request and the response body is directly
written to a file descriptor. This makes it check the HTTP status
code before writing it, and do not write the response body if it's an
error response. It's ok without this check now because post_rpc makes
a request with CURLOPT_FAILONERROR, and libcurl won't call the
callback if the response has an error status code.
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
---
http.c | 99 +++++++++++++++++++++++++++++----------------------
remote-curl.c | 29 ++++++++++++---
2 files changed, 81 insertions(+), 47 deletions(-)
diff --git a/http.c b/http.c
index eacc2a75e..d23417670 100644
--- a/http.c
+++ b/http.c
@@ -165,6 +165,19 @@ static int http_schannel_check_revoke = 1;
*/
static int http_schannel_use_ssl_cainfo;
+/*
+ * Where to store the result of http_request.
+ *
+ * At most one of buffer or file can be non-NULL. The buffer and file are not
+ * allocated by http_request, and the caller is responsible for releasing them.
+ */
+struct http_response_dest {
+ struct strbuf *buffer;
+
+ FILE *file;
+ const char *filename;
+};
+
size_t fread_buffer(char *ptr, size_t eltsize, size_t nmemb, void *buffer_)
{
size_t size = eltsize * nmemb;
@@ -1794,12 +1807,8 @@ static void http_opt_request_remainder(CURL *curl, off_t pos)
curl_easy_setopt(curl, CURLOPT_RANGE, buf);
}
-/* http_request() targets */
-#define HTTP_REQUEST_STRBUF 0
-#define HTTP_REQUEST_FILE 1
-
static int http_request(const char *url,
- void *result, int target,
+ struct http_response_dest *dest,
const struct http_get_options *options)
{
struct active_request_slot *slot;
@@ -1812,21 +1821,23 @@ static int http_request(const char *url,
slot = get_active_slot();
curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);
- if (result == NULL) {
- curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 1);
- } else {
+ if (dest->file) {
+ off_t posn = ftello(dest->file);
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
- curl_easy_setopt(slot->curl, CURLOPT_FILE, result);
-
- if (target == HTTP_REQUEST_FILE) {
- off_t posn = ftello(result);
- curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION,
- fwrite);
- if (posn > 0)
- http_opt_request_remainder(slot->curl, posn);
- } else
- curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION,
- fwrite_buffer);
+ curl_easy_setopt(slot->curl, CURLOPT_FILE,
+ dest->file);
+ curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION,
+ fwrite);
+ if (posn > 0)
+ http_opt_request_remainder(slot->curl, posn);
+ } else if (dest->buffer) {
+ curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
+ curl_easy_setopt(slot->curl, CURLOPT_FILE,
+ dest->buffer);
+ curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION,
+ fwrite_buffer);
+ } else {
+ curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 1);
}
accept_language = get_accept_language();
@@ -1930,10 +1941,10 @@ static int update_url_from_redirect(struct strbuf *base,
}
static int http_request_reauth(const char *url,
- void *result, int target,
+ struct http_response_dest *dest,
struct http_get_options *options)
{
- int ret = http_request(url, result, target, options);
+ int ret = http_request(url, dest, options);
if (ret != HTTP_OK && ret != HTTP_REAUTH)
return ret;
@@ -1949,32 +1960,34 @@ static int http_request_reauth(const char *url,
if (ret != HTTP_REAUTH)
return ret;
- /*
- * If we are using KEEP_ERROR, the previous request may have
- * put cruft into our output stream; we should clear it out before
- * making our next request. We only know how to do this for
- * the strbuf case, but that is enough to satisfy current callers.
- */
- if (options && options->keep_error) {
- switch (target) {
- case HTTP_REQUEST_STRBUF:
- strbuf_reset(result);
- break;
- default:
- BUG("HTTP_KEEP_ERROR is only supported with strbufs");
+ if (dest->file) {
+ /*
+ * At this point, the file contains the response body of the
+ * previous request. We need to truncate the file.
+ */
+ FILE *new_file = freopen(dest->filename, "w", dest->file);
+ if (new_file == NULL) {
+ error("Unable to open local file %s", dest->filename);
+ return HTTP_ERROR;
}
+ dest->file = new_file;
+ } else if (dest->buffer) {
+ strbuf_reset(dest->buffer);
}
credential_fill(&http_auth);
- return http_request(url, result, target, options);
+ return http_request(url, dest, options);
}
int http_get_strbuf(const char *url,
- struct strbuf *result,
+ struct strbuf *dest_buffer,
struct http_get_options *options)
{
- return http_request_reauth(url, result, HTTP_REQUEST_STRBUF, options);
+ struct http_response_dest dest;
+ dest.file = NULL;
+ dest.buffer = dest_buffer;
+ return http_request_reauth(url, &dest, options);
}
/*
@@ -1988,18 +2001,20 @@ static int http_get_file(const char *url, const char *filename,
{
int ret;
struct strbuf tmpfile = STRBUF_INIT;
- FILE *result;
+ struct http_response_dest dest;
strbuf_addf(&tmpfile, "%s.temp", filename);
- result = fopen(tmpfile.buf, "a");
- if (!result) {
+ dest.buffer = NULL;
+ dest.file = fopen(tmpfile.buf, "a");
+ if (!dest.file) {
error("Unable to open local file %s", tmpfile.buf);
ret = HTTP_ERROR;
goto cleanup;
}
+ dest.filename = tmpfile.buf;
- ret = http_request_reauth(url, result, HTTP_REQUEST_FILE, options);
- fclose(result);
+ ret = http_request_reauth(url, &dest, options);
+ fclose(dest.file);
if (ret == HTTP_OK && finalize_object_file(tmpfile.buf, filename))
ret = HTTP_ERROR;
diff --git a/remote-curl.c b/remote-curl.c
index 1220dffcd..48656bf18 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -546,14 +546,31 @@ static curlioerr rpc_ioctl(CURL *handle, int cmd, void *clientp)
}
#endif
+struct rpc_in_data {
+ struct rpc_state *rpc;
+ struct active_request_slot *slot;
+};
+
+/*
+ * A callback for CURLOPT_WRITEFUNCTION. The return value is the bytes consumed
+ * from ptr.
+ */
static size_t rpc_in(char *ptr, size_t eltsize,
size_t nmemb, void *buffer_)
{
size_t size = eltsize * nmemb;
- struct rpc_state *rpc = buffer_;
+ struct rpc_in_data *data = buffer_;
+ long response_code;
+
+ if (curl_easy_getinfo(data->slot->curl, CURLINFO_RESPONSE_CODE,
+ &response_code) != CURLE_OK)
+ return size;
+ if (response_code != 200)
+ return size;
+
if (size)
- rpc->any_written = 1;
- write_or_die(rpc->in, ptr, size);
+ data->rpc->any_written = 1;
+ write_or_die(data->rpc->in, ptr, size);
return size;
}
@@ -633,6 +650,7 @@ static int post_rpc(struct rpc_state *rpc)
size_t gzip_size = 0;
int err, large_request = 0;
int needs_100_continue = 0;
+ struct rpc_in_data rpc_in_data;
/* Try to load the entire request, if we can fit it into the
* allocated buffer space we can use HTTP/1.0 and avoid the
@@ -765,8 +783,9 @@ static int post_rpc(struct rpc_state *rpc)
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, rpc_in);
- curl_easy_setopt(slot->curl, CURLOPT_FILE, rpc);
-
+ rpc_in_data.rpc = rpc;
+ rpc_in_data.slot = slot;
+ curl_easy_setopt(slot->curl, CURLOPT_FILE, &rpc_in_data);
rpc->any_written = 0;
err = run_slot(slot, NULL);
--
2.20.1.415.g653613c723-goog
^ permalink raw reply related
* Re: RFE: version-controlled merge rules
From: Jonathan Nieder @ 2018-12-27 23:55 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: git
In-Reply-To: <ad875f1e-54e1-e19f-cd65-95ab503c6de2@zytor.com>
Hi,
H. Peter Anvin wrote:
> [merge "version"]
> name = Version file merge driver
> driver = sort -V -r %O %A %B | head -1 > %A.tmp.1 && mv -f %A.tmp.1 %A
[...]
> However, I can't even put this in .gitattributes, because doing so would break
> any user who *doesn't* have the previous rule defined locally. Even worse, if
> this rule needs to change, propagating it to all new users has to be done
> manually... never mind if it needs to vary by branch!
>
> The simplest way to address this would presumably be to let the
> repository/working directory contain a .gitconfig file that can contain rules
> like that. (Allowing it to be in the repository proper is probably a
> requirement for merges to be handled correctly on bare repositories; I'm not
> sure how .gitattributes is handled for that.)
The main issue I see is that this would make it a little *too* easy to
run arbitrary code on the user's machine. Build systems often already
lead to that, but users are more familiar with the risks for build
than for version control.
See [1] for some related discussion.
That said, using the include.path feature (see git-config(1)), it's
possible to do something similar:
[include]
path = ../.gitconfig
Thanks and hope that helps,
Jonathan
[1] https://public-inbox.org/git/20171002234517.GV19555@aiede.mtv.corp.google.com/
^ permalink raw reply
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