Re: [PATCH 0/4] doc-diff: support diffing from/to AsciiDoc(tor)

2019-03-17 Thread Junio C Hamano
Martin Ågren writes: > I've taught `doc-diff` a few new knobs to support usage like > > $ ./doc-diff --from-asciidoc --to-asciidoctor HEAD HEAD Nice. > But I have made some progress on fixing up Asciidoctor *and* AsciiDoc > issues using this, and once the output of the above command is empty

Re: [PATCH] t4038-diff-combined: quote paths with whitespace

2019-03-17 Thread Junio C Hamano
Todd Zullinger writes: > d76ce4f734 ("log,diff-tree: add --combined-all-paths option", > 2019-02-07) added tests for files containing tabs. > > When the tests are run with bash, the lack of quoting during the file > setup causes 'ambiguous redirect' errors. Thanks.

Re: [PATCH] git-diff.txt: prefer not using ..

2019-03-17 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > Sure, and if we're going to change our docs to consistently use @ at > either side of such ranges instead of the empty string for "HEAD" I > think that's worth discussing if the goal is to get rid of ".." for > "diff". > > I'm commenting on the in-between state b

Re: [PATCH] git-diff.txt: prefer not using ..

2019-03-17 Thread Junio C Hamano
Duy Nguyen writes: >> - This is synonymous to the previous form. If on >> + This is synonymous to the previous form. However, >> + users should prefer the previous form over this form >> + as this form may be more confusing due to the same >> + notation having a l

Re: [PATCH v8 00/11] Fix scissors bug during conflict

2019-03-17 Thread Junio C Hamano
SZEDER Gábor writes: >> +git commit ${3+"$3"} -m "$2" >act && >> +head -1 tmp && >> +mv tmp act && > > Here you could swap the order of when you write to 'act' and 'tmp', > and thus make the 'mv' unnecessary, like this: > > git commit [...] >tmp && > head -1 act >tmp && > [...re

Re: [PATCH] send-email: don't cc *-by lines with '-' prefix

2019-03-17 Thread Junio C Hamano
Joe Perches writes: > My preference would be for correctness. > I presume something like this isn't too onerous. I am guessing that /^---/ is to stop at the three-dash line *OR* after the initial handful of lines of the first diff header (as the last resort) and that is why it is not looking for

Re: [PATCH v1 1/1] trace2: NULL is not allowed for va_list

2019-03-17 Thread Junio C Hamano
tbo...@web.de writes: > From: Torsten Bögershausen > > Some compilers don't allow NULL to be passed for a va_list. > Use va_list instead. Wow (I seem to be keep saying this today). > > Signed-off-by: Torsten Bögershausen > --- > trace2.c| 15 +++ > trace2.h

Re: [PATCH v3 0/8] gc: minor code cleanup + contention fixes

2019-03-17 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > Changes since v2: > > * The "let's detect that we don't need work in reflog expire" patch >is gone, as noted in a new set of tests/commit messages that was >tricker than expected, and not worth it. > > * Minor rewording fixes to commit messages. > > *

Re: [PATCH v3] rebase: remove the rebase.useBuiltin setting

2019-03-17 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > Urgh, Junio: If there's no other comments/concerns on v3 requiring a v4 > this has my: > > Signed-off-by: Ævar Arnfjörð Bjarmason Alright. Let's queue, wait for a while to see if there is anything else and continue. Thanks.

Re: [PATCH v2 6/7] gc: don't run "reflog expire" when keeping reflogs

2019-03-17 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: >>> + if (gc_config_is_timestamp_never("gc.reflogexpire") && >>> + gc_config_is_timestamp_never("gc.reflogexpireunreachable")) >> >> Nit. configset api normalizes the key internally, so we can safely >> write gc.reflogExpireUnreachable here, which i

Re: [PATCH] doc: fix typos in man pages

2019-03-17 Thread Junio C Hamano
Alexander Blesius writes: > Signed-off-by: Alexander Blesius > --- > Documentation/git-worktree.txt | 4 ++-- > Documentation/gitattributes.txt | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt > index

Re: [PATCH] fix pack protocol example client/server communication

2019-03-17 Thread Junio C Hamano
Mike Hommey writes: > The pkt-line formatted lines contained the wrong pkt-len. Wow. > > Signed-off-by: Mike Hommey > --- > Documentation/technical/pack-protocol.txt | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/Documentation/technical/pack-protocol.txt > b

Re: [PATCH v9 0/3]

2019-03-17 Thread Junio C Hamano
nbelakov...@gmail.com writes: > From: Nickolai Belakovski > > Cleanup on 2/3 and 3/3 I'll have to re-read the test part myself to see what you meant by the "strategy for updating tests" and if it makes sense, but what you wrote as the goal and approach in the cover letter all sounded sensible.

Re: Shorthand for "$(git merge-base A B)"

2019-03-17 Thread Junio C Hamano
Jonathan Nieder writes: > John Passaro wrote: > >> I find myself fairly frequently doing something like "git log $(git >> merge-base A B)..C". > > Hm. Can you tell me more about the workflow / higher-level operation > where you do this? Yes indeed, that would be interesting to learn. I can thi

Re: [WIP PATCH/RFC] Use a higher range-diff --creation-factor for format-patch

2019-03-17 Thread Junio C Hamano
Eric Sunshine writes: > So, I'm fairly negative on this change. However, that doesn't mean I > would oppose tweaking the value shared between the two programs (and > also the default used by GitGitGadget, if it specifies it manually), > though I defer to Dscho in that regard. I do not think of a

Re: [PATCH v4 00/26] Add new command 'switch'

2019-03-17 Thread Junio C Hamano
Duy Nguyen writes: > I did forget one thing: > > - 'git switch' refuses to switch in the middle of > rebase/bisect/cherry-pick/... session. Add --ignore-in-progress to > override this I think that is a sensible thing to do. Once I did not realize that a "checkout" from a failed cherry-pick with

Re: [PATCH 0/2] stash: handle pathspec magic again

2019-03-17 Thread Junio C Hamano
Johannes Schindelin writes: > To appease you enough that you stop complaining about the current, or > previous, state of `ps/stash-in-c`. > ... First of all, you do not have to appease me. What happened in the past has happened already, and whether I complain or not, the fact that the history w

Re: [PATCH v3 17/21] switch: no implicit dwim, use --guess to dwim

2019-03-17 Thread Junio C Hamano
Eric Sunshine writes: > With git-checkout, it's very easy to accidentally get into a detached > HEAD state, so it makes some sense to protect newcomers, by default, > from that accident in git-switch. However, auto-creation of a new > local branch is not, for a couple reasons, nearly so weighty a

Re: [PATCH] unpack-trees: fix oneway_merge accidentally carry over stage index

2019-03-17 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > One-way merge is supposed to take stat info from the index and > everything else from the given tree. This implies stage 0 because trees > can't have non-zero stages. The add_entry(.., old, ...) call however > will keep stage index from the index. > > This is norma

Re: [PATCH v8 00/11] Fix scissors bug during conflict

2019-03-17 Thread Denton Liu
Hi Szeder, On Sun, Mar 17, 2019 at 02:05:39PM +0100, SZEDER Gábor wrote: > On Sun, Mar 17, 2019 at 03:15:50AM -0700, Denton Liu wrote: > > Sorry for taking so long to do a reroll, I've been pretty busy this week > > and I've only been able to find the time now. > > No problem, and thank you for s

Re: [RFC/PATCH] point pull requesters to Git Git Gadget

2019-03-17 Thread Junio C Hamano
Jeff King writes: > Hmm. I guess it is still an issue in GGG. This thread has identical > timestamps on patches 1 and 2 (and my server received them out of order > by 2 seconds, so mutt orders them wrong): > > https://public-inbox.org/git/pull.163.git.gitgitgad...@gmail.com/ > > I do still thin

Re: [PATCH v2 2/3] parse-options: make OPT_ARGUMENT() more useful

2019-03-17 Thread Junio C Hamano
Jeff King writes: >> +`OPT_ARGUMENT(long, &int_var, description)`:: >> Introduce a long-option argument that will be kept in `argv[]`. >> +If this option was seen, `int_var` will be set to one (except >> +if a `NULL` pointer was passed). > > So this effectively makes it into a "bool"

Re: ls-remote set timeout

2019-03-17 Thread Junio C Hamano
Jakobus Schürz writes: > Does anyone has an idea? Lack of response generally indicate that people are not interested but the reason why they are not varies. It may be because you did not give them sufficient information about your situation (are you trying to do this on Windows, for example?).

Re: Update of Bulgarian translation of gitk

2019-03-17 Thread Junio C Hamano
Paul Mackerras writes: > On Wed, Mar 13, 2019 at 01:06:32PM +0100, Alexander Shopov wrote: >> >> >> Hello all, >> I am resending the update of Bulgarina translation of Gitk that I last sent >> here: >> on 4 of March: https://marc.info/?l=git&m=155169580131311&w=2 >> Any idea why it is not gett

Re: [PATCH v8 3/3] branch: add worktree info on verbose output

2019-03-17 Thread Junio C Hamano
Nickolai Belakovski writes: > On Thu, Feb 21, 2019 at 4:59 AM Jeff King wrote: >> >> On Tue, Feb 19, 2019 at 05:31:23PM +0900, nbelakov...@gmail.com wrote: >> >> > From: Nickolai Belakovski >> > >> > To display worktree path for refs checked out in a linked worktree >> >> This would be a good p

Re: [PATCH v3 10/21] checkout: split part of it to new command 'switch'

2019-03-17 Thread Junio C Hamano
Elijah Newren writes: > I don't see why even makes sense to use with --orphan; > you should error if both are given, IMO. The point of --orphan is to > create some entirely new history. So, I'd expect "git switch --orphan > " to: > * not create refs/heads/ > * set HEAD to refs/heads/ > *

Re: [PATCH] send-email: don't cc *-by lines with '-' prefix

2019-03-17 Thread Joe Perches
On Sun, 2019-03-17 at 20:27 +0100, Rasmus Villemoes wrote: > On 16/03/2019 20.26, Baruch Siach wrote: > > Since commit ef0cc1df90f6b ("send-email: also pick up cc addresses from > > -by trailers") in git version 2.20, git send-email adds to cc list > > addresses from all *-by lines. As a side effec

Draft of Git Rev News edition 49

2019-03-17 Thread Christian Couder
Hi everyone! A draft of a new Git Rev News edition is available here: https://github.com/git/git.github.io/blob/master/rev_news/drafts/edition-49.md Everyone is welcome to contribute in any section either by editing the above page on GitHub and sending a pull request, or by commenting on this

Re: [PATCH 03/11] test-lib: introduce 'test_atexit'

2019-03-17 Thread Junio C Hamano
SZEDER Gábor writes: >> but it even skips when there is no point doing the >> test_eval_ of the "accumulated" scriptlet when it is empty. > > But this is not, because $test_cleanup is initialized to this special > value and it can never be empty, and indeed 'test_eval_' uses this > condition: > >

Re: [PATCH 2/2] trace2: randomize/timestamp trace2 targets

2019-03-17 Thread Junio C Hamano
Josh Steadmon writes: > On 2019.03.15 13:43, Josh Steadmon wrote: >> On 2019.03.14 00:49, Ævar Arnfjörð Bjarmason wrote: >> > >> > On Thu, Mar 14 2019, Josh Steadmon wrote: >> > >> > > When the value of a trace2 environment variable contains instances of >> > > the string "%ISO8601%", expand th

Re: am/cherry-pick/rebase/revert: document --rerere-autoupdate

2019-03-17 Thread Junio C Hamano
Phillip Wood writes: > I've squashed the first tree patches together Thanks. The result of the series has no changes and that is good.

Re: separating regression test patches from fixes, was Re: [PATCH 3/3] cherry-pick --continue: remember options

2019-03-17 Thread Junio C Hamano
Duy Nguyen writes: > On Thu, Mar 14, 2019 at 9:10 PM Johannes Schindelin > wrote: >> In any case, before we get better tooling to work around these issues, I >> still think it makes a ton of sense to encourage proper separation of >> concerns: to keep patches that introduce regression tests demo

Re: [PATCH] t4038-diff-combined: quote paths with whitespace

2019-03-17 Thread Eric Sunshine
On Sun, Mar 17, 2019 at 7:02 PM Todd Zullinger wrote: > d76ce4f734 ("log,diff-tree: add --combined-all-paths option", > 2019-02-07) added tests for files containing tabs. s/files/filenames/ > When the tests are run with bash, the lack of quoting during the file > setup causes 'ambiguous redirect

[PATCH] t4038-diff-combined: quote paths with whitespace

2019-03-17 Thread Todd Zullinger
d76ce4f734 ("log,diff-tree: add --combined-all-paths option", 2019-02-07) added tests for files containing tabs. When the tests are run with bash, the lack of quoting during the file setup causes 'ambiguous redirect' errors. Signed-off-by: Todd Zullinger --- Hi, I noticed these failures while r

[PATCH v3] glossary: add definition for overlay

2019-03-17 Thread Thomas Gummerer
Add a definition for what overlay means in the context of git, to clarify the recently introduced overlay-mode in git checkout. Helped-by: Elijah Newren Helped-by: Junio C Hamano Signed-off-by: Thomas Gummerer --- v3 incorporates Junios suggestions from [*1*], and clarifies that this only appl

Re: [GSoC][PATCH v3 3/3] t0000: use test_line_count instead of wc -l

2019-03-17 Thread Thomas Gummerer
On 03/17, Ævar Arnfjörð Bjarmason wrote: > > On Sun, Mar 17 2019, Jonathan Chang wrote: > > > Signed-off-by: Jonathan Chang > > --- > > t/t-basic.sh | 7 +++ > > 1 file changed, 3 insertions(+), 4 deletions(-) > > > > diff --git a/t/t-basic.sh b/t/t-basic.sh > > index 47666b013e

Re: [PATCH] asciidoctor-extensions: provide ``

2019-03-17 Thread Martin Ågren
Hi Todd, On Sun, 17 Mar 2019 at 20:44, Todd Zullinger wrote: > > Hi Martin, > > Martin Ågren wrote: > > That is, we miss out on the `` tags. As a result, the > > header of each man page doesn't say "Git Manual", but "git-foo(1)" > > instead. Worse, the footers don't give the Git version number an

Re: [PATCH] asciidoctor-extensions: provide ``

2019-03-17 Thread Todd Zullinger
Hi Martin, Martin Ågren wrote: > When we build with AsciiDoc, asciidoc.conf ensures that each xml-file we > generate contains some meta-information which `xmlto` can act on, based > on the following template: > > > {mantitle} > {manvolnum} > Git > {git_version} > Git Manual > > >

Re: [PATCH] send-email: don't cc *-by lines with '-' prefix

2019-03-17 Thread Rasmus Villemoes
On 16/03/2019 20.26, Baruch Siach wrote: > Since commit ef0cc1df90f6b ("send-email: also pick up cc addresses from > -by trailers") in git version 2.20, git send-email adds to cc list > addresses from all *-by lines. As a side effect a line with > '-Signed-off-by' is now also added to cc. This make

Re: [PATCH v4 04/26] git-checkout.txt: fix monospace typeset

2019-03-17 Thread Martin Ågren
On Sun, 17 Mar 2019 at 13:50, Nguyễn Thái Ngọc Duy wrote: > > Add backticks where we have none, replace single quotes with backticks > and replace double-quotes. Drop double-quotes from nested constructions > such as `"@{-1}"`. Add a missing possessive apostrophe after the word > "submodules" whil

Re: [PATCH v4 03/26] doc: document --overwrite-ignore

2019-03-17 Thread Martin Ågren
On Sun, 17 Mar 2019 at 13:49, Nguyễn Thái Ngọc Duy wrote: > > I added this option in git-checkout and git-merge in c1d7036b6b > (checkout,merge: disallow overwriting ignored files with > --no-overwrite-ignore - 2011-11-27) but did not remember to update > documentation. This completes that commit.

[PATCH 1/4] Doc: auto-detect changed build flags

2019-03-17 Thread Martin Ågren
If you build the documentation switching between different options, e.g., to build with both Asciidoc and Asciidoctor, you'll probably find yourself running `make -C Documentation clean` either too often (wasting time) or too rarely (getting mixed builds). Track the flags we're using in the docume

[PATCH 3/4] doc-diff: support diffing from/to AsciiDoc(tor)

2019-03-17 Thread Martin Ågren
Provide `--from-asciidoctor` and `--to-asciidoctor` to select that the "from" resp. "to" commit should be built with Asciidoctor, and provide an `--asciidoctor` shortcut for giving both. Similarly, provide --{from-,to-,}asciidoc for explicitly selecting AsciiDoc. Implement this using the USE_ASCII

[PATCH 4/4] doc-diff: add `--cut-header-footer`

2019-03-17 Thread Martin Ågren
AsciiDoc and Asciidoctor do not agree on what to write in the header and footer of each man-page, i.e., the very first and the very last line of *.[157]. Those differences can certainly be interesting in their own right, but they clutter the output of `./doc-diff --from-asciidoc --to-asciidoctor HE

[PATCH 2/4] doc-diff: let `render_tree()` take an explicit directory name

2019-03-17 Thread Martin Ågren
In `render_tree()`, `$1` is documented to be the commit-ish/oid and we use it as that with `git checkout`, but we mostly use it to form the name of various directories. To separate these concerns, and because we are about to construct the directory names a bit differently, take two distinct argumen

[PATCH 0/4] doc-diff: support diffing from/to AsciiDoc(tor)

2019-03-17 Thread Martin Ågren
I've taught `doc-diff` a few new knobs to support usage like $ ./doc-diff --from-asciidoc --to-asciidoctor HEAD HEAD and I don't think I've messed it up too badly in the process. I'm open to the idea that this might not be interesting to a whole lot of people. But I have made some progress on f

[PATCH v2 3/4] completion: fix multiple command removals

2019-03-17 Thread Todd Zullinger
From: Jeff King Commit 6532f3740b ("completion: allow to customize the completable command list", 2018-05-20) tried to allow multiple space-separated entries in completion.commands. To do this, it copies each parsed token into a strbuf so that the result is NUL-terminated. However, for tokens st

[PATCH v2 0/4] completion.commands: fix multiple command removals

2019-03-17 Thread Todd Zullinger
Hi, Duy Nguyen wrote: > Poking this thread before it goes completely dead... I've been meaning to send out a re-rolled version. I didn't realize 2 weeks had slipped by already. :/ > On Sat, Mar 2, 2019 at 12:34 AM Todd Zullinger wrote: >> >> The completion.commands config var must be set in ei

[PATCH v2 1/4] git: read local config in --list-cmds

2019-03-17 Thread Todd Zullinger
From: Jeff King Normally code that is checking config before we've decided to do setup_git_directory() would use read_early_config(), which uses discover_git_directory() to tentatively see if we're in a repo, and if so to add it to the config sequence. But list_cmds() uses the caching configset

[PATCH v2 2/4] t9902: test multiple removals via completion.commands

2019-03-17 Thread Todd Zullinger
6532f3740b ("completion: allow to customize the completable command list", 2018-05-20) added the completion.commands config variable. Multiple commands may be added or removed, separated by a space. Demonstrate the failure of multiple removals. Signed-off-by: Todd Zullinger --- t/t9902-completi

[PATCH v2 4/4] completion: use __git when calling --list-cmds

2019-03-17 Thread Todd Zullinger
Since e51bdea6d3 ("git: read local config in --list-cmds", 2019-03-01), the completion.commands variable respects repo-level configuration. Use __git which ensures that the proper repo config is consulted if the command line contains 'git -C /some/other/repo'. Suggested-by: SZEDER Gábor Signed-o

Re: [GSoC][PATCH v3 3/3] t0000: use test_line_count instead of wc -l

2019-03-17 Thread Ævar Arnfjörð Bjarmason
On Sun, Mar 17 2019, Jonathan Chang wrote: > Signed-off-by: Jonathan Chang > --- > t/t-basic.sh | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/t/t-basic.sh b/t/t-basic.sh > index 47666b013e..3de13daabe 100755 > --- a/t/t-basic.sh > +++ b/t/t

Re: [GSoC][PATCH v3 2/3] t0000: avoid using pipes

2019-03-17 Thread Ævar Arnfjörð Bjarmason
On Sun, Mar 17 2019, Jonathan Chang wrote: > The exit code of the upstream in a pipe is ignored thus we should avoid > using it. By writing out the output of the git command to a file, we can > test the exit codes of both the commands. > > Signed-off-by: Jonathan Chang > --- > t/t-basic.sh

[GSoC][PATCH v3 0/3] Avoid using pipes

2019-03-17 Thread Jonathan Chang
Hi, This is my SoC 2019 Microproject: "Avoid pipes in git related commands in test scripts". Changes since v2: - drop changes to other 2 files as suggested by Christian Couder[1] - rename commit message from "t-basic:" to "t:"[1] - use better commit message suggest

[GSoC][PATCH v3 1/3] t0000: fix indentation

2019-03-17 Thread Jonathan Chang
Fix indentation of a line containing a pipeline to reduce the noise when refactoring the pipeline in a subsequent commit. This has been wrong since the refactoring done in 1b5b2b641a ("t: modernise style", 2012-03-02), but carries no meaning. Signed-off-by: Jonathan Chang --- t/t-basic.s

[GSoC][PATCH v3 2/3] t0000: avoid using pipes

2019-03-17 Thread Jonathan Chang
The exit code of the upstream in a pipe is ignored thus we should avoid using it. By writing out the output of the git command to a file, we can test the exit codes of both the commands. Signed-off-by: Jonathan Chang --- t/t-basic.sh | 28 ++-- 1 file changed, 14 inse

[GSoC][PATCH v3 3/3] t0000: use test_line_count instead of wc -l

2019-03-17 Thread Jonathan Chang
Signed-off-by: Jonathan Chang --- t/t-basic.sh | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/t/t-basic.sh b/t/t-basic.sh index 47666b013e..3de13daabe 100755 --- a/t/t-basic.sh +++ b/t/t-basic.sh @@ -1136,8 +1136,8 @@ test_expect_success 'git commit

[PATCH] asciidoctor-extensions: provide ``

2019-03-17 Thread Martin Ågren
When we build with AsciiDoc, asciidoc.conf ensures that each xml-file we generate contains some meta-information which `xmlto` can act on, based on the following template: {mantitle} {manvolnum} Git {git_version} Git Manual When we build with Asciidoctor, it does not honor this co

Re: [PATCH v6 00/15] Trace2 tracing facility

2019-03-17 Thread Ævar Arnfjörð Bjarmason
On Fri, Feb 15 2019, Jeff Hostetler wrote: > On 2/14/2019 7:33 AM, Ævar Arnfjörð Bjarmason wrote: >> >> On Wed, Feb 06 2019, Jeff Hostetler via GitGitGadget wrote: >> >>> V6 addresses: [] The remaining hdr-check warning in trace2/tr2_tls.h >>> >>> There are no other outstanding comments that I'm

Re: [PATCH] git-diff.txt: prefer not using ..

2019-03-17 Thread Ævar Arnfjörð Bjarmason
On Sun, Mar 17 2019, Duy Nguyen wrote: > On Sun, Mar 17, 2019 at 8:41 PM Ævar Arnfjörð Bjarmason > wrote: >> >> >> On Sun, Mar 17 2019, Denton Liu wrote: >> >> > The documentation used to consider >> > >> > git diff >> > >> > and >> > >> > git diff .. >> > >> > to be equal counter

Re: [PATCH] git-diff.txt: prefer not using ..

2019-03-17 Thread Duy Nguyen
On Sun, Mar 17, 2019 at 8:41 PM Ævar Arnfjörð Bjarmason wrote: > > > On Sun, Mar 17 2019, Denton Liu wrote: > > > The documentation used to consider > > > > git diff > > > > and > > > > git diff .. > > > > to be equal counterparts. However, rev-list-ish commands also use the > > .. n

Re: [PATCH] git-diff.txt: prefer not using ..

2019-03-17 Thread Ævar Arnfjörð Bjarmason
On Sun, Mar 17 2019, Denton Liu wrote: > The documentation used to consider > > git diff > > and > > git diff .. > > to be equal counterparts. However, rev-list-ish commands also use the > .. notation, but in a logically conflicting manner which > was confusing for some users (incl

Re: [PATCH] git-diff.txt: prefer not using ..

2019-03-17 Thread Duy Nguyen
On Sun, Mar 17, 2019 at 6:09 PM Denton Liu wrote: > > The documentation used to consider > > git diff > > and > > git diff .. > > to be equal counterparts. However, rev-list-ish commands also use the > .. notation, but in a logically conflicting manner which > was confusing for s

Re: [PATCH 1/3] doc: note config file restrictions for completion.commands

2019-03-17 Thread Duy Nguyen
Poking this thread before it goes completely dead... On Sat, Mar 2, 2019 at 12:34 AM Todd Zullinger wrote: > > The completion.commands config var must be set in either the system-wide > or global config file. The completion script does not read a local > repository config. After the last discus

Re: [PATCH v8 00/11] Fix scissors bug during conflict

2019-03-17 Thread SZEDER Gábor
On Sun, Mar 17, 2019 at 03:15:50AM -0700, Denton Liu wrote: > Sorry for taking so long to do a reroll, I've been pretty busy this week > and I've only been able to find the time now. No problem, and thank you for sticking with it! > diff --git a/t/t7502-commit-porcelain.sh b/t/t7502-commit-porce

Re: [PATCH v4 00/26] Add new command 'switch'

2019-03-17 Thread Duy Nguyen
On Sun, Mar 17, 2019 at 7:49 PM Nguyễn Thái Ngọc Duy wrote: > > Thanks for all the comments from v3 (and before), I didn't expect > feedback from so many people. v4 fixes most of them, but still leaves > a couple for v5. > > - -C remains because people seem to need it > > - --recreate vs --force-c

[PATCH v4 24/26] t: add tests for switch

2019-03-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t2060-switch.sh (new +x) | 97 ++ 1 file changed, 97 insertions(+) diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh new file mode 100755 index 00..62ec1bb924 --- /dev/null +++ b/t/t2060-switch.sh @@ -0,0 +1,9

[PATCH v4 19/26] switch: add short option for --detach

2019-03-17 Thread Nguyễn Thái Ngọc Duy
"git checkout" automatically detaches branches and --detach is not that useful (--no-detach is more likely). But for "switch", you may want to use it more often once you're used to detached HEAD. This of course adds -d to git-checkout but it does not harm (yet?) to do it. Signed-off-by: Nguyễn Thá

[PATCH v4 25/26] completion: support switch

2019-03-17 Thread Nguyễn Thái Ngọc Duy
Completion support for --guess could be made better. If no --detach is given, we should only provide a list of refs/heads/* and dwim ones, not the entire ref space. But I still can't penetrate that __git_refs() function yet. Signed-off-by: Nguyễn Thái Ngọc Duy --- contrib/completion/git-completi

[PATCH v4 26/26] doc: promote "git switch"

2019-03-17 Thread Nguyễn Thái Ngọc Duy
The new command "git switch" is added to avoid the confusion of one-command-do-all "git checkout" for new users. They are also helpful to avoid ambiguation context. For these reasons, promote it everywhere possible. This includes documentation, suggestions/advice from other commands... Signed-off

[PATCH v4 23/26] switch: --orphan defaults to empty tree as HEAD

2019-03-17 Thread Nguyễn Thái Ngọc Duy
Switching and creating branches always involves knowing the to begin the new branch from. Sometimes, people want to create a new branch that does not have any commits yet; --orphan is a flag to allow that. If is not specified, instead of leaving index/worktree unchanged, default to "empty tree"

[PATCH v4 22/26] switch: reject if some operation is in progress

2019-03-17 Thread Nguyễn Thái Ngọc Duy
Unless you know what you're doing, switching to another branch to do something then switching back could be confusing. Worse, you may even forget that you're in the middle of something. By the time you realize, you may have done a ton of work and it gets harder to go back. The new option --ignore-

[PATCH v4 17/26] switch: reject "do nothing" case

2019-03-17 Thread Nguyễn Thái Ngọc Duy
"git checkout" can be executed without any arguments. What it does is not exactly great: it switches from HEAD to HEAD and shows worktree modification as a side effect. Make switch reject this case. Just use "git status" if you want that side effect. For switch, you have to either - really switch

[PATCH v4 18/26] switch: only allow explicit detached HEAD

2019-03-17 Thread Nguyễn Thái Ngọc Duy
"git checkout " will checkout the commit in question and detach HEAD from the current branch. It is naturally a right thing to do once you get git references. But detached HEAD is a scary concept to new users because we show a lot of warnings and stuff, and it could be hard to get out of (until you

[PATCH v4 20/26] switch: implicit dwim, use --no-guess to disable it

2019-03-17 Thread Nguyễn Thái Ngọc Duy
This is already the default in git-checkout. The real change in here is just minor cleanup. The main excuse is to explain why dwim is kept default. Contrary to detach mode that is easy to get into and confusing to get back out. Automatically creating a tracking branch often does not kick in as oft

[PATCH v4 21/26] switch: no worktree status unless real branch switch happens

2019-03-17 Thread Nguyễn Thái Ngọc Duy
When we switch from one branch to another, it makes sense to show a summary of local changes since there could be conflicts, or some files left modified When switch is used solely for creating a new branch (and "switch" to the same commit) or detaching, we don't really need to show anything. "

[PATCH v4 12/26] checkout: split part of it to new command 'switch'

2019-03-17 Thread Nguyễn Thái Ngọc Duy
"git checkout" doing too many things is a source of confusion for many users (and it even bites old timers sometimes). To remedy that, the command will be split into two new ones: switch and restore. The good old "git checkout" command is still here and will be until all (or most of users) are sick

[PATCH v4 15/26] switch: remove -l

2019-03-17 Thread Nguyễn Thái Ngọc Duy
This option is ancient. Nowadays reflog is enabled by default and automatically created for new branches. Keep it in git-checkout only. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/checkout.c b/builtin/chec

[PATCH v4 10/26] checkout: move 'confict_style' and 'dwim_..' to checkout_opts

2019-03-17 Thread Nguyễn Thái Ngọc Duy
These local variables are referenced by struct option[]. This struct will soon be broken down, moved away and we can't rely on local variables anymore. Move these two to struct checkout_opts in preparation for that. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 17 ++--

[PATCH v4 16/26] switch: stop accepting pathspec

2019-03-17 Thread Nguyễn Thái Ngọc Duy
This command is about switching branch (or creating a new one) and should not accept pathspec. This helps simplify ambiguation handling. The other two ("git checkout" and "git restore") of course do accept pathspec as before. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 20 ++

[PATCH v4 13/26] switch: better names for -b and -B

2019-03-17 Thread Nguyễn Thái Ngọc Duy
The shortcut of these options do not make much sense when used with switch. And their descriptions are also tied to checkout. Move -b/-B to cmd_checkout() and new -c/-C with the same functionality in cmd_switch_branch() Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 32

[PATCH v4 14/26] switch: add --discard-changes

2019-03-17 Thread Nguyễn Thái Ngọc Duy
--discard-changes is a better name than --force for this option since it's what really happens. --force is turned to an alias for --discard-changes. But it's meant to an alias for potentially more force options in the future. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 12 ++

[PATCH v4 09/26] checkout: make "opts" in cmd_checkout() a pointer

2019-03-17 Thread Nguyễn Thái Ngọc Duy
"opts" will soon be moved out of cmd_checkout(). To keep changes in that patch smaller, convert "opts" to a pointer and keep the real thing behind "real_opts". Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 115 +++-- 1 file changed, 58 inser

[PATCH v4 07/26] checkout: keep most #include sorted

2019-03-17 Thread Nguyễn Thái Ngọc Duy
The include list becomes very long and frankly a bit unorganized. With the exception of builtin.h, cache.h or git-compat-util.h which have to come first, keep the rest sorted. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 34 +- 1 file changed, 17 i

[PATCH v4 05/26] t: rename t2014-switch.sh to t2014-checkout-switch.sh

2019-03-17 Thread Nguyễn Thái Ngọc Duy
The old name does not really say that this is about 'checkout -b'. See 49d833dc07 (Revert "checkout branch: prime cache-tree fully" - 2009-05-12) for more information Signed-off-by: Nguyễn Thái Ngọc Duy --- t/{t2014-switch.sh => t2014-checkout-switch.sh} | 0 1 file changed, 0 insertions(+), 0 d

[PATCH v4 08/26] checkout: factor out some code in parse_branchname_arg()

2019-03-17 Thread Nguyễn Thái Ngọc Duy
This is in preparation for the new command restore, which also needs to parse opts->source_tree but does not need all the disambiguation logic. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 51 -- 1 file changed, 31 insertions(+), 20 del

[PATCH v4 11/26] checkout: split options[] array in three pieces

2019-03-17 Thread Nguyễn Thái Ngọc Duy
This is a preparation step for introducing new commands that do parts of what checkout does. There will be two new commands, one is about switching branches, detaching HEAD... one about checking out paths. These share the a subset of command line options. The rest of command line options are separa

[PATCH v4 04/26] git-checkout.txt: fix monospace typeset

2019-03-17 Thread Nguyễn Thái Ngọc Duy
Add backticks where we have none, replace single quotes with backticks and replace double-quotes. Drop double-quotes from nested constructions such as `"@{-1}"`. Add a missing possessive apostrophe after the word "submodules" while at it. Helped-by: Martin Ågren Signed-off-by: Martin Ågren Signe

[PATCH v4 03/26] doc: document --overwrite-ignore

2019-03-17 Thread Nguyễn Thái Ngọc Duy
I added this option in git-checkout and git-merge in c1d7036b6b (checkout,merge: disallow overwriting ignored files with --no-overwrite-ignore - 2011-11-27) but did not remember to update documentation. This completes that commit. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-checkou

[PATCH v4 06/26] checkout: advice how to get out of detached HEAD mode

2019-03-17 Thread Nguyễn Thái Ngọc Duy
Detached HEAD mode is considered dangerous and confusing for newcomers and we print a big block of warning how to move forward. But we should also suggest the user the way to get out of it if they get into detached HEAD by mistake. While at there, I also suggest how to turn the advice off. This is

[PATCH v4 02/26] git-checkout.txt: fix one syntax line

2019-03-17 Thread Nguyễn Thái Ngọc Duy
can be omitted in this syntax, and it's actually documented a few paragraphs down: You could omit , in which case the command degenerates to "check out the current branch", which is a glorified no-op with rather expensive side-effects to show only the tracking information, if exists, for

[PATCH v4 01/26] git-checkout.txt: spell out --no-option

2019-03-17 Thread Nguyễn Thái Ngọc Duy
It's easier to search for and also less cryptic. Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-checkout.txt | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index f179b43732..99c8c0dc0f 100

[PATCH v4 00/26] Add new command 'switch'

2019-03-17 Thread Nguyễn Thái Ngọc Duy
Thanks for all the comments from v3 (and before), I didn't expect feedback from so many people. v4 fixes most of them, but still leaves a couple for v5. - -C remains because people seem to need it - --recreate vs --force-create: there was no strong preference for either, so I stick with --force

[PATCH] git-diff.txt: prefer not using ..

2019-03-17 Thread Denton Liu
The documentation used to consider git diff and git diff .. to be equal counterparts. However, rev-list-ish commands also use the .. notation, but in a logically conflicting manner which was confusing for some users (including me!). Deprecating the notation entirely is not re

[PATCH v8 08/11] merge: cleanup messages like commit

2019-03-17 Thread Denton Liu
This change allows git-merge messages to be cleaned up with the commit.cleanup configuration or --cleanup option, just like how git-commit does it. We also give git-pull the passthrough option of --cleanup so that it can also take advantage of this change. Finally, add testing to ensure that mess

[PATCH v8 09/11] merge: add scissors line on merge conflict

2019-03-17 Thread Denton Liu
This fixes a bug where the scissors line is placed after the Conflicts: section, in the case where a merge conflict occurs and commit.cleanup = scissors. Next, if commit.cleanup = scissors is specified, don't produce a scissors line in commit if one already exists in the MERGE_MSG file. Reviewed-

[PATCH v8 07/11] sequencer.c: remove duplicate code

2019-03-17 Thread Denton Liu
Since we implemented get_cleanup_mode, we had some duplicate code in git_sequencer_config which essentially performed the same operations. Refactor git_sequencer_config to take advantage of the logic already in get_cleanup_mode. Note that we had to introduce a separate argument to get_cleanup_mode

[PATCH v8 10/11] sequencer.c: define describe_cleanup_mode

2019-03-17 Thread Denton Liu
Define a function which allows us to get the string configuration value of a enum commit_msg_cleanup_mode. This is done by refactoring get_cleanup_mode such that it uses a lookup table to find the mappings between string and enum and then using the same LUT in reverse to define describe_cleanup_mod

[PATCH v8 11/11] cherry-pick/revert: add scissors line on merge conflict

2019-03-17 Thread Denton Liu
Fix a bug where the scissors line is placed after the Conflicts: section, in the case where a merge conflict occurs and commit.cleanup = scissors. Reviewed-by: Phillip Wood Signed-off-by: Denton Liu --- Documentation/git-cherry-pick.txt | 7 +++ Documentation/git-revert.txt | 7 +++ buil

[PATCH v8 06/11] parse-options.h: extract common --cleanup option

2019-03-17 Thread Denton Liu
The --cleanup option is commonly used. Extract it so that its definition is not repeated. Helped-by: Phillip Wood Signed-off-by: Denton Liu --- builtin/commit.c | 2 +- builtin/tag.c| 3 +-- parse-options.h | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/commi

  1   2   >