Re: curious about wording in "man git-config", ENVIRONMENT

2018-06-26 Thread Robert P. J. Day
On Tue, 26 Jun 2018, Jeff King wrote: > On Tue, Jun 26, 2018 at 06:18:26AM -0400, Robert P. J. Day wrote: > > > > > ENVIRONMENT > > GIT_CONFIG > > Take the configuration from the given file instead of > > .git/config. Using the "--global" option forces this to > >

Re: [RFC PATCH v5] Implement --first-parent for git rev-list --bisect

2018-06-26 Thread Johannes Schindelin
Hi Chris, On Tue, 26 Jun 2018, Christian Couder wrote: > On Mon, Jun 25, 2018 at 7:33 PM, Junio C Hamano wrote: > > Tiago Botelho writes: > > > >> +test_expect_success "--bisect-all --first-parent" ' > >> +cat >expect1 < >> +$(git rev-parse CC) (dist=2) > >> +$(git rev-parse EX) (dist=1) > >>

Re: [PATCH 4/5] commit-graph: store graph in struct object_store

2018-06-26 Thread Junio C Hamano
Jonathan Tan writes: > As for whether both these functions are necessary in the first place, I > think they are. I do not mind their existence. I was wondering if they can share more implementation; such a design would need s/the_commit_graph/the_repo->objstore->commit_graph/ only once as a

[GSoC][PATCH v3 2/2] rebase-interactive: rewrite the edit-todo functionality in C

2018-06-26 Thread Alban Gruin
This rewrites the edit-todo functionality from shell to C. To achieve that, a new command mode, `edit-todo`, is added, and the `write-edit-todo` flag is removed, as the shell script does not need to write the edit todo help message to the todo list anymore. The shell version is then stripped in

[GSoC][PATCH v3 0/2] rebase -i: rewrite the edit-todo functionality in C

2018-06-26 Thread Alban Gruin
This patch rewrites the edit-todo functionality from shell to C. This is part of the effort to rewrite interactive rebase in C. This patch is based on the fourth iteration of my series rewriting append_todo_help() in C. Changes since v2: - Moving edit_todo() from sequencer.c to

[GSoC][PATCH v3 1/2] editor: add a function to launch the sequence editor

2018-06-26 Thread Alban Gruin
As part of the rewrite of interactive rebase, the sequencer will need to open the sequence editor to allow the user to edit the todo list. Instead of duplicating the existing launch_editor() function, this refactors it to a new function, launch_specified_editor(), which takes the editor as a

Re: [PATCH 00/29] t: detect and fix broken &&-chains in subshells

2018-06-26 Thread Elijah Newren
Hi Eric, On Tue, Jun 26, 2018, 2:31 AM Eric Sunshine wrote: > > On Tue, Jun 26, 2018 at 5:20 AM Elijah Newren wrote: > > On Tue, Jun 26, 2018 at 12:29 AM, Eric Sunshine > > wrote: > > > Aside from identifying a rather significant number of &&-chain breaks, > > > repairing those broken chains

[GSoC][PATCH v4 2/2] rebase--interactive: rewrite append_todo_help() in C

2018-06-26 Thread Alban Gruin
This rewrites append_todo_help() from shell to C. It also incorporates some parts of initiate_action() and complete_action() that also write help texts to the todo file. This also introduces the source file rebase-interactive.c. This file will contain functions necessary for interactive rebase

[GSoC][PATCH v4 1/2] sequencer: make two functions and an enum from sequencer.c public

2018-06-26 Thread Alban Gruin
This makes rebase_path_todo(), get_missign_commit_check_level() and the enum check_level accessible outside sequencer.c. This will be needed for the rewrite of append_todo_help() from shell to C, as it will be in a new library source file, rebase-interactive.c. Signed-off-by: Alban Gruin ---

[GSoC][PATCH v4 0/2] rebase -i: rewrite append_todo_help() in C

2018-06-26 Thread Alban Gruin
This patch rewrites append_todo_help() from shell to C. The C version covers a bit more than the old shell version. To achieve that, some parameters were added to rebase--helper. This also introduce a new source file, rebase-interactive.c. This is part of the effort to rewrite interactive rebase

Re: [PATCH v3 0/7] grep.c: teach --column to 'git-grep(1)'

2018-06-26 Thread Junio C Hamano
Taylor Blau writes: > On Mon, Jun 25, 2018 at 02:43:50PM -0400, Jeff King wrote: >> On Fri, Jun 22, 2018 at 10:49:26AM -0500, Taylor Blau wrote: >> > Since the last time, only a couple of things have changed at Peff's >> > suggestions in [1]. The changes are summarized here, and an inter-diff >>

Re: [RFC PATCH v5] Implement --first-parent for git rev-list --bisect

2018-06-26 Thread Christian Couder
Hi Dscho, On Tue, Jun 26, 2018 at 4:10 PM, Johannes Schindelin wrote: > > On Tue, 26 Jun 2018, Christian Couder wrote: > >> On Mon, Jun 25, 2018 at 7:33 PM, Junio C Hamano wrote: >> >> > I hate to say this, but the above looks like a typical >> > unmaintainable mess. >> > >> > What happens when

Re: [PATCH 10/29] t9001: fix broken "invoke hook" test

2018-06-26 Thread Jonathan Tan
> diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh > index e80eacbb1b..776769fe0d 100755 > --- a/t/t9001-send-email.sh > +++ b/t/t9001-send-email.sh > @@ -1966,11 +1966,11 @@ test_expect_success $PREREQ 'invoke hook' ' > > # Verify error message when a patch is rejected

Re: [PATCH 29/29] t/test-lib: teach --chain-lint to detect broken &&-chains in subshells

2018-06-26 Thread Junio C Hamano
Eric Sunshine writes: > The --chain-lint option detects broken &&-chains by forcing the test to > exit early (as the very first step) with a sentinel value. If that > sentinel is the test's overall exit code, then the &&-chain is intact; > if not, then the chain is broken. Unfortunately, this

Re: git rerere and diff3

2018-06-26 Thread Nicolas Dechesne
On Tue, Jun 26, 2018 at 9:05 PM Junio C Hamano wrote: > > Nicolas Dechesne writes: > > > i have noticed that merge.conflictstyle has an impact on the rerere > > resolution. looking briefly at the source code, it seems that git > > tries to discard the common ancestor diff3 bits, but what I am

Re: [PATCH 00/29] t: detect and fix broken &&-chains in subshells

2018-06-26 Thread Junio C Hamano
Eric Sunshine writes: > The --chain-lint[1] option detects breakage in the top-level &&-chain of > tests. This series undertakes the more complex task of teaching it to > also detect &&-chain breakage within subshells. See patch 29/29 for the > gory details of how that's done. I first looked at

Re: [PATCH 14/29] t: drop subshell with missing &&-chain in favor of simpler construct

2018-06-26 Thread Eric Sunshine
On Tue, Jun 26, 2018 at 3:31 PM Junio C Hamano wrote: > Eric Sunshine writes: > > These tests employ a noisy subshell (with missing &&-chain) to feed > > input into Git commands: > > > > (echo a; echo b; echo c) | git some-command ... > > > > Drop the subshell in favor of a simple 'printf':

Re: [PATCH v2 2/6] submodule-config: add helper function to get 'fetch' config from .gitmodules

2018-06-26 Thread Junio C Hamano
Antonio Ospite writes: > Add a helper function to make it clearer that retrieving 'fetch' > configuration from the .gitmodules file is a special case supported > solely for backward compatibility purposes. > ... Then perhaps the new public function deserves a comment stating that? > +struct

Re: [PATCH 14/29] t: drop subshell with missing &&-chain in favor of simpler construct

2018-06-26 Thread Junio C Hamano
Eric Sunshine writes: > These tests employ a noisy subshell (with missing &&-chain) to feed > input into Git commands: > > (echo a; echo b; echo c) | git some-command ... > > Drop the subshell in favor of a simple 'printf': > > printf "%s\n" a b c | git some-command ... That's called

Re: [PATCH 29/29] t/test-lib: teach --chain-lint to detect broken &&-chains in subshells

2018-06-26 Thread Jeff King
On Tue, Jun 26, 2018 at 03:52:54PM -0400, Eric Sunshine wrote: > The existing --chain-lint already suffers the same shortcoming. Older > (or even new poorly-written) tests, even without subshells, can fall > victim already: > > (exit $sentinel) && > mkdir -p a/b/c && > cd a/b/c >

Re: [GSoC][PATCH v4 2/3] rebase -i: rewrite checkout_onto() in C

2018-06-26 Thread Junio C Hamano
Alban Gruin writes: > This rewrites checkout_onto() from shell to C. The new version is called > detach_onto(), given its role. The name, given its role, may be good, but is the implementtaion robust enough to fulfill the promise its name gives? > git rebase--helper --check-todo-list ||

Re: [PATCH] fetch-pack: support negotiation tip whitelist

2018-06-26 Thread Jonathan Nieder
Hi, Jonathan Tan wrote: > During negotiation, fetch-pack eventually reports as "have" lines all > commits reachable from all refs. Allow the user to restrict the commits > sent in this way by providing a whitelist of tips; only the tips > themselves and their ancestors will be sent. > > This

Re: [PATCH 29/29] t/test-lib: teach --chain-lint to detect broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
On Tue, Jun 26, 2018 at 3:15 PM Junio C Hamano wrote: > so, with --chain-lint, we would transform this > > mkdir -p a/b/c && > ( > cd a/b/c > rm -fr ../../* > ) && > statement 4 > > into this sequence > > (exit $sentinel) &&

Re: [GSoC][PATCH 1/1] sequencer: print an error message if append_todo_help() fails

2018-06-26 Thread Junio C Hamano
Johannes Schindelin writes: > Hi Alban, > > On Tue, 26 Jun 2018, Alban Gruin wrote: > >> This adds an error when append_todo_help() fails to write its message to >> the todo file. >> >> Signed-off-by: Alban Gruin > > ACK. > > We *may* want to fold that into the commit that adds

Re: [PATCH 29/29] t/test-lib: teach --chain-lint to detect broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
On Tue, Jun 26, 2018 at 4:17 PM Jeff King wrote: > On Tue, Jun 26, 2018 at 03:52:54PM -0400, Eric Sunshine wrote: > > So, this isn't a new problem introduced by this series, though this > > series may exacerbate it. > > Whereas once you start collapsing subshells into the main logic chain, >

Re: [PATCH v2 0/6] Restrict the usage of config_from_gitmodules to submodule-config

2018-06-26 Thread Brandon Williams
On 06/26, Antonio Ospite wrote: > Hi, > > this is version 2 of the series from > https://public-inbox.org/git/20180622162656.19338-1-...@ao2.it/ > > The .gitmodules file is not meant for arbitrary configuration, it should > be used only for submodules properties. > > Plus, arbitrary git

[PATCH] rebase -i: Fix white space in comments

2018-06-26 Thread dana
Fix a trivial white-space issue introduced by commit d48f97aa8 ("rebase: reindent function git_rebase__interactive", 2018-03-23). This affected the instructional comments displayed in the editor during an interactive rebase. Signed-off-by: dana --- Sorry if i've done any of this wrong; i've

Re: [PATCH v4 3/9] t3422: new testcases for checking when incompatible options passed

2018-06-26 Thread Junio C Hamano
Elijah Newren writes: > +# Rebase has lots of useful options like --whitepsace=fix, which are > +# actually all built in terms of flags to git-am. Since neither > +# --merge nor --interactive (nor any options that imply those two) use > +# git-am, using them together will result in flags like

Re: [BUG] url schemes should be case-insensitive

2018-06-26 Thread Jeff King
On Tue, Jun 26, 2018 at 10:09:58AM -0700, Junio C Hamano wrote: > > It may also interact in a funny way with our allowed-protocol code, if > > "SSH" gets a pass as "ssh" under the default config, but actually runs > > the otherwise-disallowed git-remote-SSH (though one would _hope_ if you > >

Re: [PATCH v2] filter-branch: skip commits present on --state-branch

2018-06-26 Thread Ian Campbell
On Mon, 2018-06-25 at 21:07 -0700, Michael Barabanov wrote: > The commits in state:filter.map have already been processed, so don't > filter them again. This makes incremental git filter-branch much > faster. > > Also add tests for --state-branch option. > > Signed-off-by: Michael Barabanov

Re: [BUG] url schemes should be case-insensitive

2018-06-26 Thread Jeff King
On Tue, Jun 26, 2018 at 02:27:39PM -0400, Jeff King wrote: > So yeah, we would not want to allow EXT::"rm -rf /" to slip past the > known-unsafe match. Any normalization should happen before then > (probably right in transport_helper_init). > > Come to think of it, that's already sort-of an

Re: [PATCH 29/29] t/test-lib: teach --chain-lint to detect broken &&-chains in subshells

2018-06-26 Thread Jeff King
On Tue, Jun 26, 2018 at 04:17:08PM -0400, Jeff King wrote: > I'm not sure if there's a good solution, though. Even if you retained > the subshells and instead did a chain-lint inside each subshell, like > this: So obviously that means "I don't think there's a good solution with this approach".

Re: [PATCH 17/29] t: use test_must_fail() instead of checking exit code manually

2018-06-26 Thread Eric Sunshine
On Tue, Jun 26, 2018 at 2:06 PM Johannes Sixt wrote: > Am 26.06.2018 um 11:21 schrieb Eric Sunshine: > >> On Tue, Jun 26, 2018 at 12:29 AM, Eric Sunshine > >> wrote: > >>> + p4 help client && > >>> + test_must_fail p4 help nosuchcommand > > [...] So, despite > > the

Re: [PATCH] fetch-pack: support negotiation tip whitelist

2018-06-26 Thread Junio C Hamano
Jonathan Tan writes: > During negotiation, fetch-pack eventually reports as "have" lines all > commits reachable from all refs. Allow the user to restrict the commits > sent in this way by providing a whitelist of tips; only the tips > themselves and their ancestors will be sent. > > This

Re: [PATCH v2 5/6] submodule-config: pass repository as argument to config_from_gitmodules

2018-06-26 Thread Junio C Hamano
Antonio Ospite writes: > Generlize config_from_gitmodules to accept a repository as an argument. generalize??? > > This is in preparation to reuse the function in repo_read_gitmodules in > order to have a single point where the '.gitmodules' file is accessed. > > Signed-off-by: Antonio Ospite

Re: [PATCH v2 4/6] submodule-config: make 'config_from_gitmodules' private

2018-06-26 Thread Junio C Hamano
Antonio Ospite writes: > Now that 'config_from_gitmodules' is not used in the open, it can be > marked as private. Nice ;-)

Re: [PATCH v2 0/6] Restrict the usage of config_from_gitmodules to submodule-config

2018-06-26 Thread Junio C Hamano
Brandon Williams writes: >> Changes since v1: >> * Remove an extra space before an arrow operator in patch 2 >> * Fix a typo in the commit message of patch 3: s/fetchobjs/fetchjobs >> * Add a note in the commit message of patch 6 about checking the >> worktree before loading

Re: [BUG] url schemes should be case-insensitive

2018-06-26 Thread Junio C Hamano
Jeff King writes: >> > We seem to match url schemes case-sensitively: >> > >> > $ git clone SSH://example.com/repo.git >> > Cloning into 'repo'... >> > fatal: Unable to find remote helper for 'SSH' >> > >> > whereas rfc3986 is clear that the scheme portion is case-insensitive. >> > We

Re: [PATCH 17/29] t: use test_must_fail() instead of checking exit code manually

2018-06-26 Thread Johannes Sixt
Am 26.06.2018 um 11:21 schrieb Eric Sunshine: On Tue, Jun 26, 2018 at 4:58 AM Elijah Newren wrote: On Tue, Jun 26, 2018 at 12:29 AM, Eric Sunshine wrote: + p4 help client && + test_must_fail p4 help nosuchcommand same question? Same answer. Not shown in this

Re: [GSoC][PATCH v3 2/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-26 Thread Junio C Hamano
Alban Gruin writes: I do not think "base_commit" is a good name, either, though. When I hear 'base' in the context of 'rebase', I would imagine that the speaker is talking about the bottom of the range of the commits to be rebased (i.e. "rebase --onto ONTO BASE BRANCH",

Re: git rerere and diff3

2018-06-26 Thread Junio C Hamano
Nicolas Dechesne writes: > i have noticed that merge.conflictstyle has an impact on the rerere > resolution. looking briefly at the source code, it seems that git > tries to discard the common ancestor diff3 bits, but what I am seeing > is that if i do the following then it fails: > > 1. from a

[PATCH v5 3/8] upload-pack: test negotiation with changing repository

2018-06-26 Thread Brandon Williams
Add tests to check the behavior of fetching from a repository which changes between rounds of negotiation (for example, when different servers in a load-balancing agreement participate in the same stateless RPC negotiation). This forms a baseline of comparison to the ref-in-want functionality

[PATCH v5 2/8] upload-pack: implement ref-in-want

2018-06-26 Thread Brandon Williams
Currently, while performing packfile negotiation, clients are only allowed to specify their desired objects using object ids. This causes a vulnerability to failure when an object turns non-existent during negotiation, which may happen if, for example, the desired repository is provided by

[PATCH v5 4/8] fetch: refactor the population of peer ref OIDs

2018-06-26 Thread Brandon Williams
Populate peer ref OIDs in get_ref_map instead of do_fetch. Besides tightening scopes of variables in the code, this also prepares for get_ref_map being able to be called multiple times within do_fetch. Signed-off-by: Brandon Williams --- builtin/fetch.c | 36 ++--

[PATCH v5 5/8] fetch: refactor fetch_refs into two functions

2018-06-26 Thread Brandon Williams
Refactor the fetch_refs function into a function that does the fetching of refs and another function that stores them. This is in preparation for allowing additional processing of the fetched refs before updating the local ref store. Signed-off-by: Brandon Williams --- builtin/fetch.c | 23

Re: [PATCH 17/29] t: use test_must_fail() instead of checking exit code manually

2018-06-26 Thread Luke Diamand
On 26 June 2018 at 08:29, Eric Sunshine wrote: > These tests intentionally break the &&-chain to manually check the exit > code of invoked commands which they expect to fail, and invert that > local expected failure into a successful exit code for the test overall. > Such manual exit code

[PATCH 20/29] t2000-t2999: fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
Signed-off-by: Eric Sunshine --- t/t2103-update-index-ignore-missing.sh | 2 +- t/t2202-add-addremove.sh | 14 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/t/t2103-update-index-ignore-missing.sh b/t/t2103-update-index-ignore-missing.sh index

[PATCH 14/29] t: drop subshell with missing &&-chain in favor of simpler construct

2018-06-26 Thread Eric Sunshine
These tests employ a noisy subshell (with missing &&-chain) to feed input into Git commands: (echo a; echo b; echo c) | git some-command ... Drop the subshell in favor of a simple 'printf': printf "%s\n" a b c | git some-command ... Signed-off-by: Eric Sunshine ---

[PATCH 29/29] t/test-lib: teach --chain-lint to detect broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
The --chain-lint option detects broken &&-chains by forcing the test to exit early (as the very first step) with a sentinel value. If that sentinel is the test's overall exit code, then the &&-chain is intact; if not, then the chain is broken. Unfortunately, this detection does not extend to

[PATCH 24/29] t5000-t5999: fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
Signed-off-by: Eric Sunshine --- t/t5300-pack-object.sh | 2 +- t/t5302-pack-index.sh | 2 +- t/t5401-update-hooks.sh| 4 ++-- t/t5406-remote-rejects.sh | 2 +- t/t5500-fetch-pack.sh | 2 +- t/t5505-remote.sh | 2 +- t/t5512-ls-remote.sh

[PATCH 18/29] t0000-t0999: fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
Signed-off-by: Eric Sunshine --- t/t-basic.sh | 2 +- t/t0003-attributes.sh | 24 t/t0021-conversion.sh | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/t/t-basic.sh b/t/t-basic.sh index af61d083b4..34859fe4a5 100755 ---

[PATCH 00/29] t: detect and fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
The --chain-lint[1] option detects breakage in the top-level &&-chain of tests. This series undertakes the more complex task of teaching it to also detect &&-chain breakage within subshells. See patch 29/29 for the gory details of how that's done. The series is built atop 'master', however, it

[PATCH 04/29] t3303: use standard here-doc tag "EOF" to avoid fooling --chain-lint

2018-06-26 Thread Eric Sunshine
An upcoming change will teach --chain-lint to detect &&-chain breakage inside subshells. The check works by performing textual transformations on the test to link the subshell body directly into the parent's &&-chain. Special care is taken with the final statement in a subshell. For instance:

[PATCH 15/29] t: drop unnecessary terminating semicolons in subshell

2018-06-26 Thread Eric Sunshine
An upcoming change will teach --chain-lint to check the &&-chain inside subshells. The semicolons after the final commands in these subshells will trip up --chain-lint since they break the &&-chain. Since those semicolons are unnecessary, just drop them. Signed-off-by: Eric Sunshine ---

[PATCH 01/29] t7508: use test_when_finished() instead of managing exit code manually

2018-06-26 Thread Eric Sunshine
This test manages its own exit code in order to perform a cleanup action unconditionally, whether the test succeeds or fails overall. In doing so, it intentionally breaks the &&-chain. Such manual exit code management to ensure cleanup predates the invention of test_when_finished(). An upcoming

[PATCH 03/29] t1300: use sane_unset() to avoid breaking &&-chain

2018-06-26 Thread Eric Sunshine
This test intentionally breaks the &&-chain after "unset HOME" since it doesn't know if 'unset' will succeed or fail. However, an upcoming change will teach --chain-lint to detect &&-chain breakage inside subshells, and it will catch this broken &&-chain. Instead, use sane_unset() which can be

[PATCH 02/29] t0001: use "{...}" block around "||" expression rather than subshell

2018-06-26 Thread Eric Sunshine
This test uses (... || true) as a shorthand for an if-then-else statement. The subshell prevents it from breaking the top-level &&-chain. However, an upcoming change will teach --chain-lint to check the &&-chain inside subshells. Although it specially recognizes and allows (... || git ...) and

[PATCH 28/29] t9119: fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
Signed-off-by: Eric Sunshine --- t/t9119-git-svn-info.sh | 120 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh index 88241baee3..8201c3e808 100755 --- a/t/t9119-git-svn-info.sh +++

[PATCH 09/29] t7810: use test_expect_code() instead of hand-rolled comparison

2018-06-26 Thread Eric Sunshine
This test manually checks the exit code of git-grep for a particular value. In doing so, it breaks the &&-chain. An upcoming change will teach --chain-lint to check the &&-chain inside subshells, so this manual exit code handling will run afoul of the &&-chain check. Therefore, replace the manual

[PATCH 12/29] t9401: drop unnecessary nested subshell

2018-06-26 Thread Eric Sunshine
This test employs an unnecessary nested subshell: (cd foo && statement1 && (cd bar && statement2)) An upcoming change will teach --chain-lint to check the &&-chain in subshells. The check works by performing textual transformations on the test to link the subshell body

[PATCH 06/29] t6036: fix broken "merge fails but has appropriate contents" tests

2018-06-26 Thread Eric Sunshine
These tests reference non-existent object "c" when they really mean to be referencing "C", however, this error went unnoticed due to a broken &&-chain later in the test. Fix these errors, as well as the broken &&-chains behind which they hid. Signed-off-by: Eric Sunshine ---

[PATCH 11/29] t9104: use "{...}" block around "||" expression rather than subshell

2018-06-26 Thread Eric Sunshine
This test uses "(... || svn ...)" as a shorthand for an if-then-else statement. The subshell prevents it from breaking the top-level &&-chain. However, an upcoming change will teach --chain-lint to check the &&-chain inside subshells. Although it takes special care to allow "||" inside subshells,

[PATCH 08/29] t7400: fix broken "submodule add/reconfigure --force" test

2018-06-26 Thread Eric Sunshine
This test has been dysfunctional since it was added by 619acfc78c (submodule add: extend force flag to add existing repos, 2016-10-06), however, two problems early in the test went unnoticed due to a broken &&-chain later in the test. First, it tries configuring the submodule with repository

[PATCH 17/29] t: use test_must_fail() instead of checking exit code manually

2018-06-26 Thread Eric Sunshine
These tests intentionally break the &&-chain to manually check the exit code of invoked commands which they expect to fail, and invert that local expected failure into a successful exit code for the test overall. Such manual exit code manipulation predates the invention of test_must_fail(). An

[PATCH 07/29] t7201: drop pointless "exit 0" at end of subshell

2018-06-26 Thread Eric Sunshine
This test employs a for-loop inside a subshell and correctly aborts the loop and fails the test overall (via "exit 1") if any iteration of the for-loop fails. Otherwise, it exits the subshell with an explicit "exit 0", presumably to indicate that all iterations of the for-loop succeeded. The

[PATCH 10/29] t9001: fix broken "invoke hook" test

2018-06-26 Thread Eric Sunshine
This test has been dysfunctional since it was added by 6489660b4b (send-email: support validate hook, 2017-05-12), however, the problem went unnoticed due to a broken &&-chain late in the test. The test wants to verify that a non-zero exit code from the 'sendemail-validate' hook causes

[PATCH 05/29] t5505: modernize and simplify hard-to-digest test

2018-06-26 Thread Eric Sunshine
This test uses a subshell within a subshell but is formatted in such a way as to suggests that the inner subshell is a sibling rather than a child, which makes it difficult to digest the test's structure and intent. Worse, the inner subshell performs cleanup of actions from earlier in the test,

[PATCH 26/29] t7000-t7999: fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
Signed-off-by: Eric Sunshine --- t/t7001-mv.sh | 2 +- t/t7201-co.sh | 40 +- t/t7400-submodule-basic.sh | 2 +- t/t7406-submodule-update.sh| 4 +-- t/t7408-submodule-reference.sh | 2 +- t/t7501-commit.sh | 52

[PATCH 16/29] t: use test_might_fail() instead of manipulating exit code manually

2018-06-26 Thread Eric Sunshine
These tests manually coerce the exit code of invoked commands to "success" when they don't care if the command succeeds or fails since failure of those commands should not cause the test to fail overall. Such manual management predates the invention of test_might_fail(). An upcoming change will

[PATCH 25/29] t6000-t6999: fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
Signed-off-by: Eric Sunshine --- t/t6010-merge-base.sh| 2 +- t/t6029-merge-subtree.sh | 16 t/t6036-recursive-corner-cases.sh| 6 +++--- t/t6042-merge-rename-corner-cases.sh | 8 t/t6043-merge-rename-directories.sh | 2 +- 5 files

[PATCH 27/29] t9000-t9999: fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
Signed-off-by: Eric Sunshine --- t/t9001-send-email.sh | 6 +++--- t/t9100-git-svn-basic.sh| 2 +- t/t9101-git-svn-props.sh| 2 +- t/t9122-git-svn-author.sh | 6 +++---

[PATCH 22/29] t3030: fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
Signed-off-by: Eric Sunshine --- t/t3030-merge-recursive.sh | 340 ++--- 1 file changed, 170 insertions(+), 170 deletions(-) diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh index 3563e77b37..ff641b348a 100755 --- a/t/t3030-merge-recursive.sh

[PATCH 21/29] t3000-t3999: fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
Signed-off-by: Eric Sunshine --- t/t3000-ls-files-others.sh | 2 +- t/t3006-ls-files-long.sh| 2 +- t/t3008-ls-files-lazy-init-name-hash.sh | 8 t/t3050-subprojects-fetch.sh| 8 t/t3301-notes.sh| 8

[PATCH 19/29] t1000-t1999: fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
Signed-off-by: Eric Sunshine --- t/t1004-read-tree-m-u-wf.sh | 8 t/t1005-read-tree-reset.sh | 10 +- t/t1008-read-tree-overlay.sh| 2 +- t/t1020-subdirectory.sh | 2 +- t/t1050-large.sh| 6 +++---

[PATCH 13/29] t/lib-submodule-update: fix broken "replace submodule must-fail" test

2018-06-26 Thread Eric Sunshine
This test has been dysfunctional since it was added by 259f3ee296 (lib-submodule-update.sh: define tests for recursing into submodules, 2017-03-14), however, problems went unnoticed due to a broken &&-chain toward the end of the test. The test wants to verify that replacing a submodule containing

[PATCH 23/29] t4000-t4999: fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
Signed-off-by: Eric Sunshine --- t/t4001-diff-rename.sh | 2 +- t/t4025-hunk-header.sh | 8 t/t4041-diff-submodule-option.sh | 4 ++-- t/t4060-diff-submodule-option-diff-format.sh | 2 +- t/t4121-apply-diffs.sh

Re: [PATCH 00/29] t: detect and fix broken &&-chains in subshells

2018-06-26 Thread Elijah Newren
On Tue, Jun 26, 2018 at 12:29 AM, Eric Sunshine wrote: > The --chain-lint[1] option detects breakage in the top-level &&-chain of > tests. This series undertakes the more complex task of teaching it to > also detect &&-chain breakage within subshells. See patch 29/29 for the > gory details of how

Re: [PATCH 00/29] t: detect and fix broken &&-chains in subshells

2018-06-26 Thread Eric Sunshine
On Tue, Jun 26, 2018 at 5:20 AM Elijah Newren wrote: > On Tue, Jun 26, 2018 at 12:29 AM, Eric Sunshine > wrote: > > Aside from identifying a rather significant number of &&-chain breaks, > > repairing those broken chains uncovered genuine bugs in several tests > > which were hidden by missing

Re: [GSoC][PATCH v3 2/3] rebase -i: rewrite setup_reflog_action() in C

2018-06-26 Thread Pratik Karki
Hi, On Tue, Jun 26, 2018 at 3:00 AM Johannes Schindelin wrote: > Pratik refactored some code from sequencer.c into checkout.c/checkout.h > today to do exactly that. It is not polished yet, but probably will be > tomorrow. It provides a function `int detach_head_to(struct object_oid > *oid,

[GSoC][PATCH 0/1] sequencer: print an error message if append_todo_help() fails

2018-06-26 Thread Alban Gruin
Currently, append_todo_help() does not warn the user if an error occurs when trying to write to the todo file. This patch addresses this problem. This patch is based on ag/rebase-i-append-todo-help. Alban Gruin (1): sequencer: print an error message if append_todo_help() fails sequencer.c |

[GSoC][PATCH 1/1] sequencer: print an error message if append_todo_help() fails

2018-06-26 Thread Alban Gruin
This adds an error when append_todo_help() fails to write its message to the todo file. Signed-off-by: Alban Gruin --- sequencer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sequencer.c b/sequencer.c index 7cc76332e..7c4bdbb99 100644 --- a/sequencer.c +++ b/sequencer.c @@ -4380,6

curious about wording in "man git-config", ENVIRONMENT

2018-06-26 Thread Robert P. J. Day
ENVIRONMENT GIT_CONFIG Take the configuration from the given file instead of .git/config. Using the "--global" option forces this to ~/.gitconfig. Using the "--system" option forces this to $(prefix)/etc/gitconfig. is the phrase "forces this to" really what you

Re: [PATCH 06/29] t6036: fix broken "merge fails but has appropriate contents" tests

2018-06-26 Thread Elijah Newren
On Tue, Jun 26, 2018 at 12:29 AM, Eric Sunshine wrote: > These tests reference non-existent object "c" when they really mean to > be referencing "C", however, this error went unnoticed due to a broken > &&-chain later in the test. Fix these errors, as well as the broken > &&-chains behind which

Re: [PATCH 17/29] t: use test_must_fail() instead of checking exit code manually

2018-06-26 Thread Elijah Newren
On Tue, Jun 26, 2018 at 12:29 AM, Eric Sunshine wrote: > These tests intentionally break the &&-chain to manually check the exit > code of invoked commands which they expect to fail, and invert that > local expected failure into a successful exit code for the test overall. > Such manual exit code

Re: [PATCH 17/29] t: use test_must_fail() instead of checking exit code manually

2018-06-26 Thread Eric Sunshine
On Tue, Jun 26, 2018 at 4:58 AM Elijah Newren wrote: > On Tue, Jun 26, 2018 at 12:29 AM, Eric Sunshine > wrote: > > [...] Therefore, > > replace the manual exit code management with test_must_fail() and a > > normal &&-chain. > > > > Signed-off-by: Eric Sunshine > > --- > > diff --git

ag/rebase-i-append-todo-help, was Re: What's cooking in git.git (Jun 2018, #06; Mon, 25)

2018-06-26 Thread Johannes Schindelin
Hi Junio & Alban, On Mon, 25 Jun 2018, Junio C Hamano wrote: > * ag/rebase-i-append-todo-help (2018-06-14) 2 commits > - rebase--interactive: rewrite append_todo_help() in C > - Merge branch 'ag/rebase-p' into ag/rebase-i-append-todo-help > (this branch is used by ag/rebase-i-rewrite-todo.) >

Re: [BUG] url schemes should be case-insensitive

2018-06-26 Thread Jeff King
On Mon, Jun 25, 2018 at 11:19:51AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > We seem to match url schemes case-sensitively: > > > > $ git clone SSH://example.com/repo.git > > Cloning into 'repo'... > > fatal: Unable to find remote helper for 'SSH' > > > > whereas rfc3986 is

Re: curious about wording in "man git-config", ENVIRONMENT

2018-06-26 Thread Jeff King
On Tue, Jun 26, 2018 at 06:18:26AM -0400, Robert P. J. Day wrote: > > ENVIRONMENT > GIT_CONFIG > Take the configuration from the given file instead of > .git/config. Using the "--global" option forces this to > ~/.gitconfig. Using the "--system" option forces this to >

[PATCH v5 0/8] ref-in-want

2018-06-26 Thread Brandon Williams
Changes in v5: * Added a comment explaining the one-time-sed.sh script * Added a number of tests per reviewer feedback * Fixed a typo in documentation Brandon Williams (8): test-pkt-line: add unpack-sideband subcommand upload-pack: implement ref-in-want upload-pack: test negotiation with

[PATCH v3] Documentation: declare "core.ignorecase" as internal variable

2018-06-26 Thread Marc Strapetz
The current description of "core.ignoreCase" reads like an option which is intended to be changed by the user while it's actually expected to be set by Git on initialization only. Subsequently, Git relies on the proper configuration of this variable, as noted by Bryan Turner [1]: Git on a

Re: [GSoC][PATCH 1/1] sequencer: print an error message if append_todo_help() fails

2018-06-26 Thread Johannes Schindelin
Hi Junio, On Tue, 26 Jun 2018, Junio C Hamano wrote: > Johannes Schindelin writes: > > > On Tue, 26 Jun 2018, Alban Gruin wrote: > > > >> This adds an error when append_todo_help() fails to write its message to > >> the todo file. > >> > >> Signed-off-by: Alban Gruin > > > > ACK. > > > > We

Re: [PATCH v2] filter-branch: skip commits present on --state-branch

2018-06-26 Thread Junio C Hamano
Ian Campbell writes: > On Mon, 2018-06-25 at 21:07 -0700, Michael Barabanov wrote: >> The commits in state:filter.map have already been processed, so don't >> filter them again. This makes incremental git filter-branch much >> faster. >> >> Also add tests for --state-branch option. >> >>

Re: [PATCH 29/29] t/test-lib: teach --chain-lint to detect broken &&-chains in subshells

2018-06-26 Thread Elijah Newren
On Tue, Jun 26, 2018 at 2:01 PM, Jeff King wrote: > On Tue, Jun 26, 2018 at 04:46:18PM -0400, Eric Sunshine wrote: >> Some of these dangers can be de-thoothed during the linting phase by >> defining do-nothing shell functions: >> >> cp () { :; } >> mv () { :; } >> ln () { :; } >> >>

[PATCH v5 6/8] fetch: refactor to make function args narrower

2018-06-26 Thread Brandon Williams
Refactor find_non_local_tags and get_ref_map to only take the information they need instead of the entire transport struct. Besides improving code clarity, this also improves their flexibility, allowing for a different set of refs to be used instead of relying on the ones stored in the transport

Re: [PATCH v2 2/6] submodule-config: add helper function to get 'fetch' config from .gitmodules

2018-06-26 Thread Antonio Ospite
On Tue, 26 Jun 2018 13:11:40 -0700 Junio C Hamano wrote: > Antonio Ospite writes: > > > Add a helper function to make it clearer that retrieving 'fetch' > > configuration from the .gitmodules file is a special case supported > > solely for backward compatibility purposes. > > ... > > Then

[PATCH v5 7/8] fetch-pack: put shallow info in output parameter

2018-06-26 Thread Brandon Williams
Expand the transport fetch method signature, by adding an output parameter, to allow transports to return information about the refs they have fetched. Then communicate shallow status information through this mechanism instead of by modifying the input list of refs. This does require clients to

Re: [PATCH v6 0/4] stash: add new tests and introduce a new helper function

2018-06-26 Thread Johannes Schindelin
Hi, On Mon, 25 Jun 2018, Paul-Sebastian Ungureanu wrote: > This first series of patches does bring some changes and improvements to > the test suite. One of the patches also introduces a new function > `get_oidf()` which will be hepful for the incoming patches related to > `git stash`. For

Re: [PATCH v6 3/4] stash: update test cases conform to coding guidelines

2018-06-26 Thread Johannes Schindelin
Hi Paul, On Mon, 25 Jun 2018, Paul-Sebastian Ungureanu wrote: > Removed whitespaces after redirection operators. That is accurate a description of what the patch does. Let's add the why (and change the tense to present tense, as is the custom in our commit messages): This adjusts

Re: [PATCH v6 4/4] stash: renamed test cases to be more descriptive

2018-06-26 Thread Johannes Schindelin
Hi Paul, On Mon, 25 Jun 2018, Paul-Sebastian Ungureanu wrote: > Renamed some test cases' labels to be more descriptive and under 80 > characters per line. > > Signed-off-by: Paul-Sebastian Ungureanu As I suggested this kind of change, I am obviously happy with this patch. Apart from minor

Re: [PATCH 29/29] t/test-lib: teach --chain-lint to detect broken &&-chains in subshells

2018-06-26 Thread Elijah Newren
On Tue, Jun 26, 2018 at 1:22 PM, Jeff King wrote: > On Tue, Jun 26, 2018 at 04:17:08PM -0400, Jeff King wrote: > >> I'm not sure if there's a good solution, though. Even if you retained >> the subshells and instead did a chain-lint inside each subshell, like >> this: > > So obviously that means

  1   2   >