Re: Parsing trailers

2019-01-02 Thread Jeff King
On Wed, Jan 02, 2019 at 11:43:55PM -0800, William Chargin wrote: > > IMHO this is a bug in --parse. It was always meant to give sane, > > normalized output > > Okay; this is good to hear. In that case, what would you think about > changing `interpret-trailers` as a whole to always emit colons? (N

Re: [PATCH 3/3] t0006-date.sh: add `human` date format tests.

2019-01-02 Thread Jeff King
On Sun, Dec 30, 2018 at 05:31:50PM -0700, Stephen P. Smith wrote: > The `human` date format varies based on two inputs: the date in the > reference time which is constant and the local computers date which > varies. Using hardcoded test expected output dates would require > holding the local mach

Re: Parsing trailers

2019-01-02 Thread William Chargin
> That's what "%(trailers:only)" does (even if the original separator was > something else). It also trims any extra whitespace. Ooh, this is good to know: thanks. (I had found `print_tok_val` in `trailer.c` and assumed that this was the only place with the output logic, but I now see that `format

Re: [PATCH 1/3] Add 'human' date format

2019-01-02 Thread Jeff King
On Sun, Dec 30, 2018 at 05:31:48PM -0700, Stephen P. Smith wrote: > Also add 'auto' date mode, which defaults to human if we're using the > pager. So you can do > > git config --add log.date auto > > and your "git log" commands will show the human-legible format unless > you're scripting

Re: Git extra hook, pre-upload

2019-01-02 Thread Jeff King
On Sun, Dec 30, 2018 at 10:34:26PM +0100, Ævar Arnfjörð Bjarmason wrote: > > On Sun, Dec 30 2018, Xheroz 128 wrote: > > > Currently, I’m doing my Final Year Project that requires a hook that > > executes automatically on the server side of the repository, before the > > objects been pulled to

Re: [PATCH v2] doc: remove unneeded TODO for release_commit_memory

2019-01-02 Thread Junio C Hamano
Duy Nguyen writes: > On Wed, Jan 2, 2019 at 3:09 AM Albert Burt wrote: >> >> Remove TODO that was left in from: >> commit 110240588d (Merge branch 'sb/object-store-alloc' - 2018-06-25) >> >> Todo can be removed as: >> 9d2c97016f (commit.h: delete 'util' field in struct commit - 2018-05-19) >> de

Re: [PATCH v4 1/4] transport-helper: use xread instead of read

2019-01-02 Thread Jeff King
On Wed, Jan 02, 2019 at 12:55:51PM -0800, Junio C Hamano wrote: > > Signed-off-by: Randall S. Becker > > --- > > 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 > > -

Re: Parsing trailers

2019-01-02 Thread Jeff King
On Sun, Dec 23, 2018 at 02:41:20PM -0800, William Chargin wrote: > I'm interested in parsing the output of `git-interpret-trailers` in a > script. I had hoped that the `--parse` option would make this easy, but > it seems that the `trailer.separators` configuration option is used to > specify both

Re: [PATCH 3/3] t0006-date.sh: add `human` date format tests.

2019-01-02 Thread Junio C Hamano
Stephen & Linda Smith writes: > On Wednesday, January 2, 2019 11:15:02 AM MST Junio C Hamano wrote: >> 'date +%s' is used everywhere in this patch but has never been used >> in our test suite before. It is not portable. > So I don't make this mistake again, Is there a reference somewhere for tha

Re: [PATCH v4 3/3] branch: Add an extra verbose output displaying worktree path for refs checked out in a linked worktree

2019-01-02 Thread Jeff King
On Mon, Dec 24, 2018 at 12:47:56AM -0800, nbelakov...@gmail.com wrote: > From: Nickolai Belakovski > > --- > builtin/branch.c | 4 > 1 file changed, 4 insertions(+) This patch should describe the new behavior in Documentation/git-branch.txt, I'd think. -Peff

Re: [PATCH v4 1/3] ref-filter: add worktreepath atom

2019-01-02 Thread Jeff King
On Mon, Dec 24, 2018 at 12:47:54AM -0800, nbelakov...@gmail.com wrote: > [...] Thanks for keeping with this. I think we're getting quite close, though I did find a few small-ish issues. > @@ -34,6 +36,8 @@ static struct ref_msg { > "ahead %d, behind %d" > }; > > +static struct worktree

Re: [PATCH v4 0/3]

2019-01-02 Thread Jeff King
On Mon, Dec 24, 2018 at 12:47:53AM -0800, nbelakov...@gmail.com wrote: > From: Nickolai Belakovski > > > I don't think that works. The default function is always_equal(), which > > will treat two entries equal if they have the same hash value. I.e., any > > collisions would be considered a match

Re: [PATCH v3] Simplify handling of setup_git_directory_gently() failure cases.

2019-01-02 Thread Jeff King
On Thu, Dec 27, 2018 at 03:36:29PM -0800, Erin Dahlgren wrote: > Before this change are two misleading additional behaviors: > > - GIT_DIR_HIT_CEILING: setup_nongit() changes to the cwd for no > apparent reason. We never had the chance to change directories > up to this point so chd

Re: [PATCH v2] Simplify handling of setup_git_directory_gently() failure cases.

2019-01-02 Thread Jeff King
On Thu, Dec 27, 2018 at 03:46:10PM -0800, Erin Dahlgren wrote: > > Heh, I should learn to cut and paste better. This should be: > > > > if (!nongit_ok || !*nongit_ok) > > > > (which comes from the current code). > > Yep, but I think we can benefit from De Morgan's law here, where: > > (!nong

Re: [PATCH v2 2/7] test-lib: parse some --options earlier

2019-01-02 Thread Jeff King
On Sun, Dec 30, 2018 at 08:04:19PM +0100, SZEDER Gábor wrote: > > (in fact, given that this is just > > the internal tests, I am tempted to say that we should just make it > > "-r" for the sake of simplicity and consistency. But maybe somebody > > would be annoyed. I have never used "-r" ever myse

Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays

2019-01-02 Thread Jeff King
On Wed, Jan 02, 2019 at 01:20:47AM +0100, Johannes Sixt wrote: > > diff --git a/t/test-lib.sh b/t/test-lib.sh > > index 0f1faa24b2..f47a191e3b 100644 > > --- a/t/test-lib.sh > > +++ b/t/test-lib.sh > > @@ -324,9 +324,12 @@ do > > # isn't executed with a suitable Bash version. > >

Re: [PATCH] banned.h: mark strncat() as banned

2019-01-02 Thread Jeff King
On Wed, Jan 02, 2019 at 09:38:46AM +, Eric Wong wrote: > strncat() has the same quadratic behavior as strcat() and is > difficult-to-read and bug-prone. While it hasn't yet been a > problem in git iself, strncat() found it's way into 'master' > of cgit and caused segfaults on my system. I'm

Re: [PATCH 3/3] t0006-date.sh: add `human` date format tests.

2019-01-02 Thread Stephen & Linda Smith
On Wednesday, January 2, 2019 11:15:02 AM MST Junio C Hamano wrote: > 'date +%s' is used everywhere in this patch but has never been used > in our test suite before. It is not portable. So I don't make this mistake again, Is there a reference somewhere for that is and is not portable? > > We pe

Re: [PATCH v17 0/7] git bisect: convert from shell to C

2019-01-02 Thread Ramsay Jones
On 02/01/2019 15:38, Tanushree Tumane via GitGitGadget wrote: [snip] > base-commit: 7f4e64169352e03476b0ea64e7e2973669e491a2 > Published-As: > https://github.com/gitgitgadget/git/releases/tag/pr-101%2Ftanushree27%2Fgit-bisect_part2_fixup-v17 > Fetch-It-Via: git fetch https://github.com/gitgitga

Re: [PATCH v2 8/8] checkout: introduce checkout.overlayMode config

2019-01-02 Thread Junio C Hamano
Thomas Gummerer writes: > In the previous patch we introduced a new no-overlay mode for git > checkout. Some users (such as the author of this commit) may want to > have this mode turned on by default as it matches their mental model > more closely. Make that possible by introducing a new confi

Re: [RFC PATCH 1/1] filter-options: Expand abbreviated numbers

2019-01-02 Thread Junio C Hamano
Josh Steadmon writes: > When communicating with a remote server or a subprocess, use expanded > numbers rather than abbreviated numbers in the object filter spec (e.g. > "limit:blob=1k" becomes "limit:blob=1024"). > > Update the protocol docs to note that clients should always perform this > expa

Re: [PATCH 1/1] commit-graph: writing missing parents is a BUG

2019-01-02 Thread Junio C Hamano
"Derrick Stolee via GitGitGadget" writes: > From: Derrick Stolee > > When writing a commit-graph, we write GRAPH_MISSING_PARENT if the > parent's object id does not appear in the list of commits to be > written into the commit-graph. This was done as the initial design > allowed commits to have

Re: [PATCH 1/1] Add author and committer configuration settings

2019-01-02 Thread Junio C Hamano
William Hubbs writes: > Subject: Re: [PATCH 1/1] Add author and committer configuration settings Perhaps something like this Subject: config: allow giving separate author and committer idents would fit better in "git shortlog --no-merges" output. > The author.email, author.nam

Submodule log bug

2019-01-02 Thread David Turner
When a submodule is renamed, git log gives incorrect output: commit 350ebece9bce8d9c495f9a51e6f5529749c5c3cc (HEAD -> master) Author: David Turner Date: Wed Jan 2 17:09:56 2019 -0500 move diff --git a/.gitmodules b/.gitmodules index da1a767..f4baf2a 100644 --- a/.gitmodules +++ b/.gitmodu

Re: [PATCH v4 1/4] transport-helper: use xread instead of read

2019-01-02 Thread Junio C Hamano
randall.s.bec...@rogers.com writes: > From: "Randall S. Becker" > > 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. Th

RE: Regression in git-subtree.sh, introduced in 2.20.1, after 315a84f9aa0e2e629b0680068646b0032518ebed

2019-01-02 Thread Strain, Roger L.
> -Original Message- > From: Marc Balmer > Sent: Monday, December 31, 2018 5:24 AM > To: Duy Nguyen > Cc: Git Mailing List ; Strain, Roger L. > ; Junio C Hamano > Subject: Re: Regression in git-subtree.sh, introduced in 2.20.1, after > 315a84f9aa0e2e629b0680068646b0032518ebed > > > >

Re: [PATCH v3] sha1-name.c: Fix handling of revisions that contain paths with brackets

2019-01-02 Thread Junio C Hamano
Stan Hu writes: > - if (len < 4 || name[len-1] != '}') > + if (len < 4) > return -1; The original does not expect any string given after the ^{} dereferencer, like :, and that is why this function returns very early for anything when name[len-1] is not a closing brace. We

Re: [PATCH] log: add %S option (like --source) to log --format

2019-01-02 Thread Junio C Hamano
issac.tro...@gmail.com writes: > From: Issac Trotts I think you want to have From: Issac Trotts instead, so that the authorship actually matches your sign-off. > - if (source) { > + if (source || (rev->pretty_given && (rev->commit_format == > CMIT_FMT_USERFORMAT) && w.sourc

Re: [PATCH] diff: add support for reading files literally with --no-index

2019-01-02 Thread Junio C Hamano
"brian m. carlson" writes: > +test_expect_success SYMLINKS 'diff --no-index --literally with symlinks' ' > + test_write_lines a b c >f1 && > + test_write_lines a d c >f2 && > + ln -s f1 s1 && > + ln -s f2 s2 && > + cat >expect <<-\EOF && > + diff --git a/s1 b/s2 > + --

Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays

2019-01-02 Thread Carlo Arenas
Tested-By: Carlo Marcelo Arenas Belón

Re: [PATCH 3/3] t0006-date.sh: add `human` date format tests.

2019-01-02 Thread Junio C Hamano
"Stephen P. Smith" writes: > +# Subtract some known constant time and look for expected field format > +TODAY_REGEX='5 hours ago' > +THIS_YEAR_REGEX='[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]* > [012][0-9]:[0-6][0-9]' > +MORE_THAN_A_YEAR_REGEX='[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]* > [0-9][0-9][0-

Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays

2019-01-02 Thread Eric Sunshine
On Tue, Jan 1, 2019 at 6:20 PM SZEDER Gábor wrote: > [...] > To my understanding both shells are right and conform to POSIX, > because the standard allows both behavior by stating the following s/behavior/behaviors/ > under '2.8.1 Consequences of Shell Errors': > > Reported-by: Max Kirillov > S

Re: [PATCH] banned.h: mark strncat() as banned

2019-01-02 Thread Eric Sunshine
On Wed, Jan 2, 2019 at 4:38 AM Eric Wong wrote: > > strncat() has the same quadratic behavior as strcat() and is > difficult-to-read and bug-prone. While it hasn't yet been a > problem in git iself, strncat() found it's way into 'master' s/iself/itself/ > of cgit and caused segfaults on my syst

Re: Git extra hook, pre-upload

2019-01-02 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > We do not have such a pre-upload hook, but could have one. There's an > old thread from 2011 detailing some potential downsides: > > https://public-inbox.org/git/CAMK1S_jaEWV=f6ihkzw_6u5ncdw0bposnx-03w9bolofeee...@mail.gmail.com/ > > FWIW I think most servers who

Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays

2019-01-02 Thread Junio C Hamano
Johannes Sixt writes: > Would it perhaps be simpler to just hide the syntax behind eval? Like > > if test -z "$test_untraceable" || { >test -n "$BASH_VERSION" && eval ' > test ${BASH_VERSINFO[0]} -gt 4 || { >test ${BAS

Re: Regression `git checkout $rev -b branch` while in a `--no-checkout` clone does not check out files

2019-01-02 Thread Anthony Sottile
On Wed, Jan 2, 2019 at 3:08 AM Duy Nguyen wrote: > > On Wed, Jan 2, 2019 at 6:36 AM Anthony Sottile wrote: > > > > Here's a simple regression test -- haven't had time to bisect this > > I can't reproduce with either 2.20.0, 2.20.1 or 'master'. It would be > great if you could bisect this. > > The

Re: [PATCH 2/2] Rebase: Run post-checkout hook on checkout

2019-01-02 Thread Johannes Schindelin
Hi Orgad, On Sat, 29 Dec 2018, org...@gmail.com wrote: > From: Orgad Shaneh > > The scripted version of rebase used to run this hook on the initial > checkout. The transition to built-in introduced a regression. > > Signed-off-by: Orgad Shaneh ACK! For lurkers: there was a "pre-review" at h

[PATCH v17 5/7] bisect--helper: `bisect_next_check` shell function in C

2019-01-02 Thread Pranit Bauva via GitGitGadget
From: Pranit Bauva Reimplement `bisect_next_check` shell function in C and add `bisect-next-check` subcommand to `git bisect--helper` to call it from git-bisect.sh . `bisect_voc` shell function is no longer useful now and is replaced by using a char *[] of "new|bad" and "good|old" values. Using

[PATCH v17 6/7] bisect--helper: `get_terms` & `bisect_terms` shell function in C

2019-01-02 Thread Pranit Bauva via GitGitGadget
From: Pranit Bauva Reimplement the `get_terms` and `bisect_terms` shell function in C and add `bisect-terms` subcommand to `git bisect--helper` to call it from git-bisect.sh . Using `--bisect-terms` subcommand is a temporary measure to port shell function in C so as to use the existing test suit

[PATCH v17 0/7] git bisect: convert from shell to C

2019-01-02 Thread Tanushree Tumane via GitGitGadget
Changes since Pranit's v16: === bisect--helper: bisect_reset shell function in C * The return !printf(...); construct was considered unsafe and disentangled into printf(...); return 0; * It is more elegant to release br

[PATCH v17 7/7] bisect--helper: `bisect_start` shell function partially in C

2019-01-02 Thread Pranit Bauva via GitGitGadget
From: Pranit Bauva Reimplement the `bisect_start` shell function partially in C and add `bisect-start` subcommand to `git bisect--helper` to call it from git-bisect.sh . The last part is not converted because it calls another shell function. `bisect_start` shell function will be completed after

[PATCH v17 1/7] bisect--helper: `bisect_reset` shell function in C

2019-01-02 Thread Pranit Bauva via GitGitGadget
From: Pranit Bauva Reimplement `bisect_reset` shell function in C and add a `--bisect-reset` subcommand to `git bisect--helper` to call it from git-bisect.sh . Using `bisect_reset` subcommand is a temporary measure to port shell functions to C so as to use the existing test suite. As more functi

[PATCH v17 3/7] wrapper: move is_empty_file() and rename it as is_empty_or_missing_file()

2019-01-02 Thread Pranit Bauva via GitGitGadget
From: Pranit Bauva is_empty_file() can help to refactor a lot of code. This will be very helpful in porting "git bisect" to C. Suggested-by: Torsten Bögershausen Mentored-by: Lars Schneider Mentored-by: Christian Couder Signed-off-by: Pranit Bauva --- builtin/am.c | 20 ++--

[PATCH v17 2/7] bisect--helper: `bisect_write` shell function in C

2019-01-02 Thread Pranit Bauva via GitGitGadget
From: Pranit Bauva Reimplement the `bisect_write` shell function in C and add a `bisect-write` subcommand to `git bisect--helper` to call it from git-bisect.sh Using `--bisect-write` subcommand is a temporary measure to port shell function in C so as to use the existing test suite. As more funct

[PATCH v17 4/7] bisect--helper: `check_and_set_terms` shell function in C

2019-01-02 Thread Pranit Bauva via GitGitGadget
From: Pranit Bauva Reimplement the `check_and_set_terms` shell function in C and add `check-and-set-terms` subcommand to `git bisect--helper` to call it from git-bisect.sh Using `--check-and-set-terms` subcommand is a temporary measure to port shell function in C so as to use the existing test s

Re: [PATCH v2] doc: remove unneeded TODO for release_commit_memory

2019-01-02 Thread Duy Nguyen
On Wed, Jan 2, 2019 at 3:09 AM Albert Burt wrote: > > Remove TODO that was left in from: > commit 110240588d (Merge branch 'sb/object-store-alloc' - 2018-06-25) > > Todo can be removed as: > 9d2c97016f (commit.h: delete 'util' field in struct commit - 2018-05-19) > deletes commit->util. > > Signed

Re: Regression `git checkout $rev -b branch` while in a `--no-checkout` clone does not check out files

2019-01-02 Thread Duy Nguyen
On Wed, Jan 2, 2019 at 6:36 AM Anthony Sottile wrote: > > Here's a simple regression test -- haven't had time to bisect this I can't reproduce with either 2.20.0, 2.20.1 or 'master'. It would be great if you could bisect this. There are no suspicious commits from 2.27.1 touching builtin/checkout

[PATCH] banned.h: mark strncat() as banned

2019-01-02 Thread Eric Wong
strncat() has the same quadratic behavior as strcat() and is difficult-to-read and bug-prone. While it hasn't yet been a problem in git iself, strncat() found it's way into 'master' of cgit and caused segfaults on my system. Signed-off-by: Eric Wong --- banned.h | 2 ++ 1 file changed, 2 insert

Re: Regression in git-subtree.sh, introduced in 2.20.1, after 315a84f9aa0e2e629b0680068646b0032518ebed

2019-01-02 Thread Marc Balmer
> [...] > >> > > Hmm.. I'm not that familiar with git-subtree.sh, so here's one last > blind shot. > > There's a format change between git-show and git-rev-parse. The former > separates commits by spaces while the latter by newlines. Will this > help? > > diff --git a/contrib/subtree/git-su