Re: git 2.16.0 segfaults on clone of specific repo

2018-01-18 Thread Duy Nguyen
On Fri, Jan 19, 2018 at 10:40 AM, brian m. carlson wrote: > On Thu, Jan 18, 2018 at 10:06:10PM -0500, Eric Sunshine wrote: >> > I have a guess about what the problem might be. Can you try this patch >> > and see if it fixes things? >> >> That does fix the crash.

Re: [PATCH 3/3] read-cache: don't write index twice if we can't write shared index

2018-01-18 Thread Duy Nguyen
On Fri, Jan 19, 2018 at 5:32 AM, SZEDER Gábor <szeder@gmail.com> wrote: > On Thu, Jan 18, 2018 at 10:37 PM, Jeff King <p...@peff.net> wrote: >> On Thu, Jan 18, 2018 at 10:00:14PM +0700, Duy Nguyen wrote: >> >>> The test suite was run as root, no wonder

Re: [PATCH v2] diff: add --compact-summary option to complement --stat

2018-01-18 Thread Duy Nguyen
On Fri, Jan 19, 2018 at 5:48 AM, Jeff King wrote: > On Thu, Jan 18, 2018 at 05:05:46PM +0700, Nguyễn Thái Ngọc Duy wrote: > >> This is partly inspired by gerrit web interface which shows diffstat >> like this, e.g. with commit 0433d533f1 (notice the "A" column on the >> third

Re: [PATCH v2] diff: add --compact-summary option to complement --stat

2018-01-18 Thread Duy Nguyen
On Fri, Jan 19, 2018 at 4:23 AM, Ævar Arnfjörð Bjarmason wrote: > Wait, isn't there a bug here in the existing --summary code, its > documentation says it'll show information "such as creations, renames > and mode changes". > > But even though your --compact-summary shows that

Re: [PATCH v2] diff: add --compact-summary option to complement --stat

2018-01-18 Thread Duy Nguyen
On Fri, Jan 19, 2018 at 1:57 AM, Eric Sunshine wrote: >> diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt >> @@ -188,6 +188,17 @@ and accumulating child directory counts in the parent >> directories: >> +--compact-summary:: >> + Output a

Re: [PATCH 3/3] read-cache: don't write index twice if we can't write shared index

2018-01-18 Thread Duy Nguyen
On Thu, Jan 18, 2018 at 08:36:32PM +0700, Duy Nguyen wrote: > On Thu, Jan 18, 2018 at 8:29 PM, Jeff King <p...@peff.net> wrote: > > On Thu, Jan 18, 2018 at 07:47:50PM +0700, Duy Nguyen wrote: > > > >> I may need help getting that log (or even better the trash director

Re: [PATCH 3/3] read-cache: don't write index twice if we can't write shared index

2018-01-18 Thread Duy Nguyen
On Thu, Jan 18, 2018 at 8:29 PM, Jeff King <p...@peff.net> wrote: > On Thu, Jan 18, 2018 at 07:47:50PM +0700, Duy Nguyen wrote: > >> I may need help getting that log (or even better the trash directory >> of t1700). I tried -m32 build, then valgrind on amd64 (because it &

Re: [PATCH 3/3] read-cache: don't write index twice if we can't write shared index

2018-01-18 Thread Duy Nguyen
On Thu, Jan 18, 2018 at 6:36 PM, SZEDER Gábor wrote: > This series, queued as 'nd/shared-index-fix', makes the 32 bit Linux > build job fail on Travis CI. Unfortunately, all it can tell us about > the failure is this: > > Test Summary Report > --- >

Re: [PATCH v3 1/3] read-cache: fix reading the shared index for other repos

2018-01-18 Thread Duy Nguyen
On Thu, Jan 18, 2018 at 1:16 AM, Jonathan Nieder <jrnie...@gmail.com> wrote: > Hi, > > Duy Nguyen wrote: >> On Wed, Jan 17, 2018 at 4:42 AM, Brandon Williams <bmw...@google.com> wrote: > >>> IIUC Split index is an index ext

Re: misleading "man git-worktree", is last "add" argument necessarily a "branch"?

2018-01-17 Thread Duy Nguyen
On Wed, Jan 17, 2018 at 7:58 PM, Robert P. J. Day wrote: > > perusing "git worktree", and man page reads: > > SYNOPSIS >git worktree add [-f] [--detach] [--checkout] [--lock] \ > [-b ] [] >

Re: [PATCH] Add shell completion for git remote rm

2018-01-17 Thread Duy Nguyen
On Wed, Jan 17, 2018 at 1:17 PM, Kevin Daudt <m...@ikke.info> wrote: > On Wed, Jan 17, 2018 at 07:44:19AM +0700, Duy Nguyen wrote: >> PS. This also makes me thing about supporting subcommand aliases, so >> that people can add back 'git remote rm' if they like (or something &g

Re: [PATCH/RFC 0/2] Automate updating git-completion.bash a bit

2018-01-17 Thread Duy Nguyen
-git-completion-helper)/" "$file" +done -- 8< -- On Wed, Jan 17, 2018 at 04:16:22PM +0700, Duy Nguyen wrote: > On Wed, Jan 17, 2018 at 7:51 AM, SZEDER Gábor <szeder@gmail.com> wrote: > > On Tue, Jan 16, 2018 at 11:36 AM, Nguyễn Thái Ngọc Duy > > <

Re: [PATCH/RFC 0/2] Automate updating git-completion.bash a bit

2018-01-17 Thread Duy Nguyen
On Wed, Jan 17, 2018 at 7:51 AM, SZEDER Gábor wrote: > On Tue, Jan 16, 2018 at 11:36 AM, Nguyễn Thái Ngọc Duy > wrote: >> I noticed --recurse-submodules was missing from git-grep complete >> list. Then I found a couple more should be on the list as well

Re: [PATCH] diff.c: flush stdout before printing rename warnings

2018-01-16 Thread Duy Nguyen
On Wed, Jan 17, 2018 at 2:06 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> The diff output is buffered in a FILE object and could still be >> partially buffered when we print these warnings (directly to fd 2). >> The output is messed up like

Re: [PATCH] Add shell completion for git remote rm

2018-01-16 Thread Duy Nguyen
On Tue, Jan 16, 2018 at 10:57:34AM -0800, Junio C Hamano wrote: > Duy Nguyen <pclo...@gmail.com> writes: > > > On Tue, Jan 16, 2018 at 4:43 AM, Keith Smiley <k...@keith.so> wrote: > >> So it sounds like either we should deprecate rm, or I should update the &

Re: [PATCH 1/2] parse-options: support --git-completion-helper

2018-01-16 Thread Duy Nguyen
On Wed, Jan 17, 2018 at 6:46 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> This option is designed to be used by git-completion.bash. For many >> simple cases, what we do in there is usually >> >> __gitcomp "lots of completion options"

Re: [PATCH 1/2] parse-options: support --git-completion-helper

2018-01-16 Thread Duy Nguyen
On Wed, Jan 17, 2018 at 1:25 AM, Jacob Keller wrote: > On Tue, Jan 16, 2018 at 2:36 AM, Nguyễn Thái Ngọc Duy > wrote: >> This option is designed to be used by git-completion.bash. For many >> simple cases, what we do in there is usually >> >>

Re: [PATCH v3 1/3] read-cache: fix reading the shared index for other repos

2018-01-16 Thread Duy Nguyen
On Wed, Jan 17, 2018 at 4:42 AM, Brandon Williams wrote: > On 01/07, Thomas Gummerer wrote: >> read_index_from() takes a path argument for the location of the index >> file. For reading the shared index in split index mode however it just >> ignores that path argument, and

Re: [PATCH] Add shell completion for git remote rm

2018-01-16 Thread Duy Nguyen
On Tue, Jan 16, 2018 at 4:43 AM, Keith Smiley wrote: > So it sounds like either we should deprecate rm, or I should update the patch > to the suggested method where we just complete remotes, but not rm in the > list of completions. I vote for deprecation. I could send a patch to

Re: [PATCH 1/1] Mark messages for translations

2018-01-15 Thread Duy Nguyen
On Mon, Jan 15, 2018 at 12:44 PM, Alexander Shopov wrote: > @@ -160,7 +160,7 @@ int check_filename(const char *prefix, const char *arg) > free(to_free); > return 0; /* file does not exist */ > } > - die_errno("failed to stat

Re: [PATCH/RFC] diff: add --compact-summary option to complement --stat

2018-01-14 Thread Duy Nguyen
On Sun, Jan 14, 2018 at 4:37 PM, Simon Ruderich wrote: > On Sat, Jan 13, 2018 at 08:22:11PM +0700, Nguyễn Thái Ngọc Duy wrote: >> [snip] >> >> For mode changes, executable bit is denoted as "(+x)" or "(-x)" when >> it's added or removed respectively. The same for when a

Re: [PATCH v3 4/3] read-cache: don't try to write index if we can't write shared index

2018-01-14 Thread Duy Nguyen
On Sun, Jan 14, 2018 at 5:37 AM, Thomas Gummerer wrote: > In a0a967568e ("update-index --split-index: do not split if $GIT_DIR is > read only", 2014-06-13), we tried to make sure we can still write an > index, even if the shared index can not be written. > > We did so by

Re: [PATCH v3 0/4] run-command.c: print env vars when GIT_TRACE is set

2018-01-12 Thread Duy Nguyen
On Sat, Jan 13, 2018 at 12:19 AM, Stefan Beller wrote: >> Oh.. before anybody asks, I'm not adding git prefix to the "cd" part. >> You're supposed to know that git moves back to worktree top dir when >> you read $GIT_TRACE (or are welcome to improve the print out). > > Heh.

Re: [PATCH v3 4/4] trace.c: be smart about what env to print in trace_run_command()

2018-01-12 Thread Duy Nguyen
On Sat, Jan 13, 2018 at 11:54 AM, Duy Nguyen <pclo...@gmail.com> wrote: > On Sat, Jan 13, 2018 at 5:54 AM, Junio C Hamano <gits...@pobox.com> wrote: >> Jeff King <p...@peff.net> writes: >> >>> I also think this is a special case of a more general problem

Re: [PATCH v3 4/4] trace.c: be smart about what env to print in trace_run_command()

2018-01-12 Thread Duy Nguyen
On Sat, Jan 13, 2018 at 5:54 AM, Junio C Hamano wrote: > Jeff King writes: > >> I also think this is a special case of a more general problem. FOO could >> appear any number of times in the "env" array, as a deletion or with >> multiple values. Our

Re: git gc --auto yelling at users where a repo legitimately has >6700 loose objects

2018-01-12 Thread Duy Nguyen
On Fri, Jan 12, 2018 at 08:46:09AM -0500, Jeff King wrote: > On Thu, Jan 11, 2018 at 10:33:15PM +0100, Ævar Arnfjörð Bjarmason wrote: > > > 4. At the end of all this, we check *again* if we have >6700 objects, > > if we do we print "run 'git prune'" to .git/gc.log, and will just > > emit

Re: git gc --auto yelling at users where a repo legitimately has >6700 loose objects

2018-01-12 Thread Duy Nguyen
On Fri, Jan 12, 2018 at 7:07 PM, Duy Nguyen <pclo...@gmail.com> wrote: >> More generally, these hard limits seem contrary to what the user cares >> about. E.g. I suspect that most of these loose objects come from >> branches since deleted in upstream, whose object

Re: git gc --auto yelling at users where a repo legitimately has >6700 loose objects

2018-01-12 Thread Duy Nguyen
On Fri, Jan 12, 2018 at 4:33 AM, Ævar Arnfjörð Bjarmason wrote: > For those rusty on git-gc's defaults, this is what it looks like in this > scenario: > > 1. User runs "git pull" > 2. git gc --auto is called, there are >6700 loose objects > 3. it forks into the background,

Re: [PATCH v2] run-command.c: print env vars when GIT_TRACE is set

2018-01-12 Thread Duy Nguyen
On Fri, Jan 12, 2018 at 2:27 AM, Junio C Hamano wrote: > I wonder how common it would be to attempt exporting a variable with > the same value, and to attempt unsetting a variable that is not > exported, which might help you reduce the clutter by hiding stuff > that truly do

Re: [PATCH v2] run-command.c: print env vars when GIT_TRACE is set

2018-01-11 Thread Duy Nguyen
On Thu, Jan 11, 2018 at 4:47 PM, Nguyễn Thái Ngọc Duy wrote: > Though, Stefan, while i'm not opposed to trace every single setting > in child_process, including variable deletion, cwd and even more, it Another thing I forgot to add, s/ and even more/, redirection&/. At some

Re: [PATCH] run-command.c: print env vars when GIT_TRACE is set

2018-01-11 Thread Duy Nguyen
On Thu, Jan 11, 2018 at 5:07 PM, Jeff King wrote: > On Wed, Jan 10, 2018 at 05:48:35PM +0700, Nguyễn Thái Ngọc Duy wrote: > >> Occasionally submodule code could execute new commands with GIT_DIR set >> to some submodule. GIT_TRACE prints just the command line which makes it >> hard

Re: [PATCH/RFC] add--interactive: ignore all internal submodule changes

2018-01-11 Thread Duy Nguyen
On Thu, Jan 11, 2018 at 2:47 AM, Stefan Beller wrote: > On Wed, Jan 10, 2018 at 3:06 AM, Nguyễn Thái Ngọc Duy > wrote: >> For 'add -i' and 'add -p' the only action we can take on a dirty >> submodule entry (from the superproject perspective) is its SHA-1.

Re: [PATCH v4 8/7] wildmatch test: skip file creation tests on Windows proper

2018-01-11 Thread Duy Nguyen
On Thu, Jan 11, 2018 at 3:24 AM, Johannes Schindelin wrote: >> diff --git a/Makefile b/Makefile >> index 2a81ae22e9..567387b558 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -644,6 +644,7 @@ X = >> >> PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS)) >> >>

Re: [PATCH v4 8/7] wildmatch test: skip file creation tests on Windows proper

2018-01-10 Thread Duy Nguyen
On Wed, Jan 10, 2018 at 5:38 PM, Adam Dinwoodie wrote: >> One disadvantage of this though, if this kind of framework does not >> get popular, then any new test feature must be added at both places >> but it's a waste of time to support both. So... > > I don't follow: if we end

Re: [PATCH] status: handle worktree renames

2018-01-10 Thread Duy Nguyen
On Wed, Jan 3, 2018 at 4:14 AM, Jeff Hostetler wrote: > Also, does this introduce any new cases for reporting conflicts? > I haven't really thought about it too much yet, but if there was a > divergent rename in both branches of a merge, do we now have to handle > showing

Re: [PATCH v4 8/7] wildmatch test: skip file creation tests on Windows proper

2018-01-10 Thread Duy Nguyen
On Mon, Jan 08, 2018 at 01:25:04PM +0100, Johannes Schindelin wrote: > I agree that it would make a ton of sense to use a proper, portable test > framework written in pure, portable C. > > However, this ship has long sailed, hasn't it? If you meant converting the whole test suite, oh yeah that's

Re: [PATCH v3 1/3] read-cache: fix reading the shared index for other repos

2018-01-08 Thread Duy Nguyen
On Tue, Jan 9, 2018 at 6:38 AM, Brandon Williams <bmw...@google.com> wrote: > On 01/08, Duy Nguyen wrote: >> On Mon, Jan 8, 2018 at 5:30 AM, Thomas Gummerer <t.gumme...@gmail.com> wrote: >> > @@ -1896,16 +1895,17 @@ int read_index_from(struct index_state *

Re: [PATCH v3 1/3] read-cache: fix reading the shared index for other repos

2018-01-08 Thread Duy Nguyen
On Mon, Jan 8, 2018 at 5:30 AM, Thomas Gummerer wrote: > @@ -1896,16 +1895,17 @@ int read_index_from(struct index_state *istate, const > char *path) > split_index->base = xcalloc(1, sizeof(*split_index->base)); > > base_sha1_hex =

Re: [PATCH v2 5/5] dir.c: stop ignoring opendir() error in open_cached_dir()

2018-01-07 Thread Duy Nguyen
On Thu, Jan 4, 2018 at 3:49 AM, Ævar Arnfjörð Bjarmason wrote: > From: Nguyễn Thái Ngọc Duy > > A follow-up to the recently fixed bugs in the untracked > invalidation. If opendir() fails it should show a warning, perhaps > this should die, but if this ever

Re: [PATCH v4 8/7] wildmatch test: skip file creation tests on Windows proper

2018-01-06 Thread Duy Nguyen
On Sat, Jan 6, 2018 at 7:51 PM, Johannes Schindelin wrote: > Nobody likes to run tests that take too > long. And look at this: > > ... > ok 1511 - ipathmatch: match 'Z' '[Z-y]' > ok 1512 - ipathmatch(ls): match '[Z-y]' 'Z' > # still have

Re: [PATCH] dir.c: avoid stat() in valid_cached_dir()

2018-01-01 Thread Duy Nguyen
On Fri, Dec 29, 2017 at 2:50 AM, Ævar Arnfjörð Bjarmason wrote: > > On Thu, Dec 28 2017, Nguyễn Thái Ngọc Duy jotted: > >> stat() may follow a symlink and return stat data of the link's target >> instead of the link itself. We are concerned about the link itself. >> >>

Re: [PATCH] dir.c: avoid stat() in valid_cached_dir()

2018-01-01 Thread Duy Nguyen
On Fri, Dec 29, 2017 at 2:10 AM, Junio C Hamano wrote: > Junio C Hamano writes: > >>> [1] >>> https://public-inbox.org/git/cacsjy8ambksp0mdlradcwn45veenc03b-gq8r8pqprdt9bm...@mail.gmail.com/ >>> >>> dir.c | 2 +- >>> 1 file changed, 1 insertion(+), 1

Re: [PATCH] Add shell completion for git remote rm

2018-01-01 Thread Duy Nguyen
On Fri, Dec 29, 2017 at 11:19 AM, Keith Smiley wrote: > It looks like that was just about preferring remove in documentation and the > like, I think it would still make sense to have both for completion since rm > is still supported. 'rm' should be deprecated. But because I did

Re: [PATCH] status: add a failing test showing a core.untrackedCache bug

2017-12-27 Thread Duy Nguyen
On Wed, Dec 27, 2017 at 07:50:29PM +0100, Ævar Arnfjörð Bjarmason wrote: > > This needs SYMLINKS prereq, which in turn means it cannot be tested > > on certain platforms. I thought Duy's answer was that this does not > > need to involve a symbolic link at all? If so, perhaps we can have > >

Re: [PATCH] status: add a failing test showing a core.untrackedCache bug

2017-12-27 Thread Duy Nguyen
On Tue, Dec 26, 2017 at 05:47:19PM +0700, Duy Nguyen wrote: > Strangely, root dir is not cached (no valid flag). I don't know why > but that's ok we'll roll with it. I figured this out. Which is good because now I know how/why the bug happens. > An invalidate_directory() call before th

Re: [PATCH v2 6/7] wt-status.c: handle worktree renames

2017-12-26 Thread Duy Nguyen
On Wed, Dec 27, 2017 at 1:14 AM, Igor Djordjevic wrote: > I`m afraid "--porcelain=v2" test might be incorrect here, as `git > status --porcelain=v2` output seems to be too, with this v2 series > applied. Test I sent previously[1] fails, and it looks valid. > > This is

Re: [PATCH v2 7/7] wt-status.c: avoid double renames in short/porcelain format

2017-12-26 Thread Duy Nguyen
On Wed, Dec 27, 2017 at 5:14 AM, Igor Djordjevic wrote: > Hi Duy, > > On 26/12/2017 10:10, Nguyễn Thái Ngọc Duy wrote: >> >> The presence of worktree rename leads to an interesting situation, >> what if the same index entry is renamed twice, compared to HEAD and to >>

Re: [PATCH] status: add a failing test showing a core.untrackedCache bug

2017-12-26 Thread Duy Nguyen
On Tue, Dec 26, 2017 at 1:45 AM, Ævar Arnfjörð Bjarmason <ava...@gmail.com> wrote: > > On Mon, Dec 25 2017, Duy Nguyen jotted: > >> On Fri, Dec 22, 2017 at 9:00 PM, Ævar Arnfjörð Bjarmason >> <ava...@gmail.com> wrote: >>> The untracked cache get

Re: [PATCH] status: handle worktree renames

2017-12-25 Thread Duy Nguyen
On Tue, Dec 26, 2017 at 9:11 AM, Duy Nguyen <pclo...@gmail.com> wrote: > On Mon, Dec 25, 2017 at 07:26:27PM +0100, Igor Djordjevic wrote: >> But I`ve noticed that "--porcelain=v2" output might still be buggy - >> this is what having both files staged shows: >&g

Re: [PATCH] status: handle worktree renames

2017-12-25 Thread Duy Nguyen
On Mon, Dec 25, 2017 at 07:26:27PM +0100, Igor Djordjevic wrote: > But I`ve noticed that "--porcelain=v2" output might still be buggy - > this is what having both files staged shows: > > $ git status --porcelain=v2 > 2 R. N... 100644 100644 100644 12f00e90b6ef79117ce6e650416b8cf517099b78

Re: [PATCH v2 8/9] rebase -i: learn to abbreviate command names

2017-12-25 Thread Duy Nguyen
On Mon, Dec 25, 2017 at 10:39 PM, Liam Beguin wrote: > I'm curious, how did you build to get this error to show? > I tried with the DEVELOPER 'flag' but nothing showed and -Wextra gave > way too much messages... > Did you just add -Wignored-qualifiers to CFLAGS? I have a

Re: [PATCH v2 8/9] rebase -i: learn to abbreviate command names

2017-12-25 Thread Duy Nguyen
On Mon, Dec 4, 2017 at 5:17 AM, Liam Beguin wrote: > +static const char command_to_char(const enum todo_command command) > +{ > + if (command < TODO_COMMENT && todo_command_info[command].c) > + return todo_command_info[command].c; > + return

Re: [PATCH] status: add a failing test showing a core.untrackedCache bug

2017-12-25 Thread Duy Nguyen
On Fri, Dec 22, 2017 at 9:00 PM, Ævar Arnfjörð Bjarmason wrote: > The untracked cache gets confused when a directory is swapped out for > a symlink to another directory. Whatever files are inside the target > of the symlink will be incorrectly shown as untracked. This issue does

Re: [BUG] File move with `add -N` shows as rename to same name

2017-12-25 Thread Duy Nguyen
On Sat, Dec 23, 2017 at 9:42 AM, Alex Vandiver wrote: > I just stumbled across the following oddity: Thanks. I'm looking into it. -- Duy

Re: [PATCH v4 07/16] refs: add refs_head_ref()

2017-09-06 Thread Duy Nguyen
On Fri, Aug 25, 2017 at 4:52 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > > ... which does what? > > Unlike refs_for_each_ref() and friends, this does not iterate. > It just uses the same function signature to make a single call >

Re: [PATCH v4 11/16] revision.c: --all adds HEAD from all worktrees

2017-09-06 Thread Duy Nguyen
On Thu, Aug 24, 2017 at 2:54 AM, Stefan Beller wrote: >> +int other_head_refs(each_ref_fn fn, void *cb_data) >> +{ >> + struct worktree **worktrees, **p; >> + int ret = 0; >> + >> + worktrees = get_worktrees(0); >> + for (p = worktrees; *p; p++) { >> +

Re: [PATCH v4 02/16] refs.c: use is_dir_sep() in resolve_gitlink_ref()

2017-09-06 Thread Duy Nguyen
On Thu, Aug 24, 2017 at 2:14 AM, Stefan Beller wrote: > On Wed, Aug 23, 2017 at 5:36 AM, Nguyễn Thái Ngọc Duy > wrote: >> The "submodule" argument in this function is a path, which can have >> either '/' or '\\' as a separator. Use is_dir_sep() to support

Re: [PATCH v4 00/16] Fix git-gc losing objects in multi worktree

2017-09-06 Thread Duy Nguyen
On Fri, Aug 25, 2017 at 6:21 PM, Michael J Gruber wrote: > I suggest we think about the UI exposure a bit when it > comes to including all heads or naming options, though: > > * HEAD is "the current head" > * refs/heads is where all local branch heads are > > * --branches is the

Re: Undocumented change in `git branch -M` behavior

2017-08-24 Thread Duy Nguyen
On Thu, Aug 24, 2017 at 3:13 AM, Nish Aravamudan wrote: > Hello, > > Hopefully, I've got this right -- I noticed a change in behavior in git > with Ubuntu 17.10, which recently got 2.14.1. Specifically, that when in > an orphaned branch, -M ends up moving HEAD to

Re: What's cooking in git.git (Aug 2017, #04; Fri, 18)

2017-08-22 Thread Duy Nguyen
On Sat, Aug 19, 2017 at 4:26 AM, Junio C Hamano wrote: > [Discarded] > > * nd/prune-in-worktree (2017-04-24) 12 commits > . rev-list: expose and document --single-worktree > . revision.c: --reflog add HEAD reflog from all worktrees > . files-backend: make reflog iterator go

Re: [WIP/RFC 00/23] repository object

2017-05-29 Thread Duy Nguyen
On Mon, May 29, 2017 at 6:23 PM, Ævar Arnfjörð Bjarmason wrote: >>> That said, even if we never reached the point where we could handle all >>> submodule requests in-process, I think sticking the repo-related global >>> state in a struct certainly could not hurt general

Re: git worktrees must exist even if locked

2017-05-29 Thread Duy Nguyen
On Thu, May 11, 2017 at 3:24 AM, taylor, david wrote: > The Git documentation in describing worktrees says that one reason > why you might want to lock a worktree is to prevent it from being pruned > if it is on a removable media that isn't currently mounted. > > So, my

Re: [WIP/RFC 00/23] repository object

2017-05-29 Thread Duy Nguyen
On Tue, May 23, 2017 at 2:35 AM, Jeff King wrote: > On Thu, May 18, 2017 at 04:21:11PM -0700, Brandon Williams wrote: > >> When I first started working on the git project I found it very difficult to >> understand parts of the code base because of the inherently global nature of >>

Re: [RFC/PATCH] WIP: add deprecation & experimental process/interface

2017-05-29 Thread Duy Nguyen
On Sat, May 27, 2017 at 6:10 PM, Ævar Arnfjörð Bjarmason wrote: > This is the WIP start of a deprecation & experimental interface to > git. The goal is to formalize the workflow around deprecating > features, or around introducing new experimental features. > > This is much more

Re: git worktrees must exist even if locked

2017-05-29 Thread Duy Nguyen
On Tue, May 16, 2017 at 5:43 AM, Junio C Hamano wrote: > "taylor, david" writes: > >> The original report was against Git v2.12.2. I have since tried v2.12.3, >> v2.13.0, >> and the next branch. All exhibit the same symptoms. >> >> Even if you ignore

Re: What's cooking in git.git (May 2017, #06; Mon, 22)

2017-05-25 Thread Duy Nguyen
On Mon, May 22, 2017 at 1:11 PM, Junio C Hamano wrote: > * nd/fopen-errors (2017-05-09) 23 commits > - t1308: add a test case on open a config directory > - config.c: handle error on failing to fopen() > - xdiff-interface.c: report errno on failure to stat() or fopen() > -

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-25 Thread Duy Nguyen
On Tue, May 23, 2017 at 5:52 AM, Manish Goregaokar wrote: > What work is remaining for prune-in-worktree? Link to the relevant > discussions? > > I might be able to take it over the finish line. (No guarantees) The finish line should be pretty close. I've addressed

Re: [PATCH v2 1/2] refs: Add for_each_worktree_ref for iterating over all worktree HEADs

2017-05-22 Thread Duy Nguyen
On Sat, May 20, 2017 at 5:30 PM, Junio C Hamano wrote: > By the way, doesn't nd/prune-in-worktree topic that has been cooking > in 'pu' supersede this change? It not just protects the commit at > the tip of HEAD in each worktree, it also makes sure the ones in > HEAD's reflog

Re: reversion in GIT_COMMON_DIR refs path

2017-05-22 Thread Duy Nguyen
On Fri, May 19, 2017 at 9:37 PM, Joey Hess wrote: > Joey Hess wrote: >> Bisecting this test suite failure >> https://git-annex.branchable.com/git-annex_in_nixpkgs_fails_with_git-2.13.0/ >> I landed on commit f57f37e2e1bf11ab4cdfd221ad47e961ba9353a0 to git. >> >> It seems that

Re: [PATCH v2 00/21]

2017-05-09 Thread Duy Nguyen
On Sun, May 7, 2017 at 11:20 AM, Junio C Hamano wrote: > On Thu, May 4, 2017 at 2:45 PM, Junio C Hamano wrote: >> >> Nguyễn Thái Ngọc Duy writes: >> >> > Changes since v1: >> > >> > - fopen_or_warn() and warn_on_fopen_errors() are

Re: [PATCH v2 13/21] remote.c: report error on failure to fopen()

2017-05-09 Thread Duy Nguyen
Sorry for super late reply. I'm slowly catching up. On Wed, May 3, 2017 at 10:22 PM, Johannes Schindelin wrote: > Hi Duy, > > > On Wed, 3 May 2017, Nguyễn Thái Ngọc Duy wrote: > >> There's plenty of error() in this code to safely assume --quiet is not a >> concern. >>

Re: PCRE v2 compile error, was Re: What's cooking in git.git (May 2017, #01; Mon, 1)

2017-05-03 Thread Duy Nguyen
On Wed, May 3, 2017 at 4:45 PM, Johannes Schindelin wrote: >> So it makes sense to give our downstream distributors a nudge to >> switch over to it. Some contributor (i.e. me) was not happy with this nudging though. The other day I switched to some branch

Re: RFA: untracked cache vs git reset --hard

2017-05-03 Thread Duy Nguyen
On Wed, May 3, 2017 at 5:27 PM, Johannes Schindelin wrote: > Hi all, > > I have a problem and would like to solicit advice how to fix it. > > The untracked cache has made a real difference on rather large > repositories with tons of directories, and it is really,

Re: [PATCH 0/5] Start of a journey: drop NO_THE_INDEX_COMPATIBILITY_MACROS

2017-05-03 Thread Duy Nguyen
On Tue, May 2, 2017 at 8:36 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> This applies to origin/master. >> >> For better readability and understandability for newcomers it is a good idea >> to not offer 2 APIs doing the same thing with on being

Re: [PATCH] cache-tree: reject entries with null sha1

2017-05-03 Thread Duy Nguyen
On Tue, May 2, 2017 at 2:22 AM, Jeff King <p...@peff.net> wrote: > On Mon, May 01, 2017 at 01:23:28PM +0200, René Scharfe wrote: > >> Am 24.04.2017 um 12:39 schrieb Duy Nguyen: >> > BTW, I ran t7009 with valgrind and it reported this. Is it something >> > w

Re: [PATCH 07/15] remote.c: report error on failure to fopen()

2017-04-27 Thread Duy Nguyen
On Thu, Apr 27, 2017 at 12:07 PM, Johannes Sixt wrote: > Am 27.04.2017 um 02:57 schrieb Junio C Hamano: >> >> Johannes Sixt writes: >> >>> +++ git ls-remote 'refs*master' >>> +warning: unable to access '.git/branches/refs*master': Invalid argument >>> fatal:

Re: [PATCH] test: remove unused parameter from the wildmatch test

2017-04-26 Thread Duy Nguyen
On Tue, Apr 25, 2017 at 4:51 PM, Ævar Arnfjörð Bjarmason wrote: > We wouldn't be using fnmatch(), but I think it's a probably a good > idea for the tests to support a mode where we have to declare > explicitly whether something should also match under fnmatch or not, > so we

Re: BUG: wildmatches like foo/**/**/bar don't match properly due to internal optimizations

2017-04-26 Thread Duy Nguyen
On Wed, Apr 26, 2017 at 2:13 AM, Ævar Arnfjörð Bjarmason wrote: > Thought I'd just start another thread for this rather than tack it > onto the pathalogical case thread. > > In commit 4c251e5cb5 ("wildmatch: make /**/ match zero or more > directories", 2012-10-15) Duy added

Re: [BUG] test suite broken with GETTEXT_POISON=YesPlease

2017-04-24 Thread Duy Nguyen
On Fri, Apr 21, 2017 at 9:54 PM, Lars Schneider wrote: > >> Am 20.04.2017 um 23:58 schrieb Ævar Arnfjörð Bjarmason : >> >> As a refresh of everyone's memory (because mine needed it). This is a >> feature I added back in 2011 when the i18n support was

Re: [PATCH 1/5] add SWAP macro

2017-04-24 Thread Duy Nguyen
On Mon, Apr 24, 2017 at 6:49 PM, Jeff King wrote: > diff --git a/prio-queue.c b/prio-queue.c > index 17252d231..fc3860fdc 100644 > --- a/prio-queue.c > +++ b/prio-queue.c > @@ -21,7 +21,7 @@ void prio_queue_reverse(struct prio_queue *queue) > > if (queue->compare != NULL) >

Re: [PATCH 1/6] worktree.c: add validate_worktree()

2017-04-24 Thread Duy Nguyen
On Fri, Apr 21, 2017 at 9:16 AM, Junio C Hamano wrote: >> +int validate_worktree(const struct worktree *wt, int quiet) >> +{ >> + struct strbuf sb = STRBUF_INIT; >> + char *path; >> + int err, ret; >> + >> + if (is_main_worktree(wt)) { >> + /* >> +

Re: [PATCH] cache-tree: reject entries with null sha1

2017-04-24 Thread Duy Nguyen
On Sat, Apr 22, 2017 at 1:46 AM, Jeff King wrote: > We generally disallow null sha1s from entering the index, > due to 4337b5856 (do not write null sha1s to on-disk index, > 2012-07-28). However, we loosened that in 83bd7437c > (write_index: optionally allow broken null sha1s, >

Re: Feature request: --format=json

2017-04-24 Thread Duy Nguyen
On Mon, Apr 24, 2017 at 3:33 PM, shawn wilson wrote: > Late to the party, but I too would also like json format output (mainly so I > could pipe stuff to jq instead of looking at the man page for which %thing > I'm looking for). That said, it's not at the PR level of want for

Re: [PATCH v3 10/12] files-backend: make reflog iterator go through per-worktree reflog

2017-04-22 Thread Duy Nguyen
On Sat, Apr 22, 2017 at 10:05:02AM +0200, Michael Haggerty wrote: > I find this implementation confusing: > > * `if (iter->worktree_dir_iterator)` sounds like it should mean > that we are iterating over worktree references but it really means > that we are iterating over the common references

Re: [PATCH v3 06/12] refs: add refs_head_ref()

2017-04-22 Thread Duy Nguyen
On Sat, Apr 22, 2017 at 1:37 PM, Michael Haggerty wrote: > On 04/19/2017 01:01 PM, Nguyễn Thái Ngọc Duy wrote: >> Signed-off-by: Nguyễn Thái Ngọc Duy >> --- >> refs.c | 19 +-- >> refs.h | 2 ++ >> 2 files changed, 11 insertions(+), 10

Re: [PATCH 00/15] Handle fopen() errors

2017-04-21 Thread Duy Nguyen
On Fri, Apr 21, 2017 at 6:52 PM, Junio C Hamano wrote: > Yes, but (1) we'd need to be careful about --quiet Yeah. It's a real pain point for making changes like this. At some point we should just have a global (maybe multi-level) quiet flag. -- Duy

Re: [BUG] test suite broken with GIT_TEST_SPLIT_INDEX

2017-04-21 Thread Duy Nguyen
On Fri, Apr 21, 2017 at 6:57 PM, Christian Couder <christian.cou...@gmail.com> wrote: > On Fri, Apr 21, 2017 at 1:46 PM, Christian Couder > <christian.cou...@gmail.com> wrote: >> On Fri, Apr 21, 2017 at 11:53 AM, Duy Nguyen <pclo...@gmail.com> wrote: >>> On

Re: [PATCH 00/15] Handle fopen() errors

2017-04-21 Thread Duy Nguyen
On Fri, Apr 21, 2017 at 1:29 PM, Jeff King wrote: > On Thu, Apr 20, 2017 at 08:41:32PM -0700, Junio C Hamano wrote: > >> Junio C Hamano writes: >> >> > I wonder if it is OK to only special case ENOENT for !fp cases, >> > where existing code silently returns.

Re: [BUG] test suite broken with GIT_TEST_SPLIT_INDEX

2017-04-21 Thread Duy Nguyen
On Fri, Apr 21, 2017 at 2:10 PM, Christian Couder wrote: > On Thu, Apr 20, 2017 at 11:24 PM, Thomas Gummerer > wrote: >> On 04/20, Christian Couder wrote: >>> >>> Could you try with the following patch: >>> >>>

Re: [PATCH] refs.h: rename submodule arguments to submodule_path

2017-04-21 Thread Duy Nguyen
On Fri, Apr 21, 2017 at 1:42 PM, Michael Haggerty wrote: > On 04/21/2017 08:32 AM, Michael Haggerty wrote: >> [...] >> I've CCed Duy because I don't know whether he has more plans regarding >> submodule references [...] get rid of the >> `for_each_ref_submodule()` family of

Re: [PATCH v3 05/12] refs: move submodule slash stripping code to get_submodule_ref_store

2017-04-20 Thread Duy Nguyen
On Thu, Apr 20, 2017 at 5:02 AM, Johannes Sixt wrote: > Am 19.04.2017 um 13:01 schrieb Nguyễn Thái Ngọc Duy: >> >> @@ -1558,7 +1543,17 @@ struct ref_store *get_submodule_ref_store(const >> char *submodule) >> { >> struct strbuf submodule_sb = STRBUF_INIT; >> struct

Re: What's cooking in git.git (Apr 2017, #04; Wed, 19)

2017-04-20 Thread Duy Nguyen
On Wed, Apr 19, 2017 at 10:37:21PM -0700, Junio C Hamano wrote: > * nd/worktree-add-lock (2017-04-16) 2 commits > - SQUASH??? > - worktree add: add --lock option > > Allow to lock a worktree immediately after it's created. This helps > prevent a race between "git worktree add; git worktree

Re: [PATCH v3 05/12] refs: move submodule slash stripping code to get_submodule_ref_store

2017-04-19 Thread Duy Nguyen
On Thu, Apr 20, 2017 at 12:02:08AM +0200, Johannes Sixt wrote: > Am 19.04.2017 um 13:01 schrieb Nguyễn Thái Ngọc Duy: > > @@ -1558,7 +1543,17 @@ struct ref_store *get_submodule_ref_store(const char > > *submodule) > > { > > struct strbuf submodule_sb = STRBUF_INIT; > > struct ref_store

Re: [PATCH v2 12/12] rev-list: expose and document --single-worktree

2017-04-19 Thread Duy Nguyen
On Sun, Mar 19, 2017 at 1:00 AM, Junio C Hamano wrote: >> diff --git a/Documentation/rev-list-options.txt >> b/Documentation/rev-list-options.txt >> index a02f7324c0..c71e94b2d0 100644 >> --- a/Documentation/rev-list-options.txt >> +++ b/Documentation/rev-list-options.txt >>

Re: What's cooking in git.git (Apr 2017, #03; Tue, 18)

2017-04-19 Thread Duy Nguyen
On Tue, Apr 18, 2017 at 10:45:22PM -0700, Junio C Hamano wrote: > * nd/conditional-config-in-early-config (2017-04-17) 3 commits > - config: correct file reading order in read_early_config() > - config: handle conditional include when $GIT_DIR is not set up > - config: prepare to pass more info

Re: Feature request: --format=json

2017-04-17 Thread Duy Nguyen
On Mon, Apr 17, 2017 at 7:44 PM, Fred .Flintstone wrote: > So I did "git rev-list --all --pretty" and it looks like "git log". > Which outputs a human-readable format. > > However, if I want something more suitable for machine parsing, is > there any way to get that output? >

Re: How to keep log history when renaming and changing simultaneously

2017-04-17 Thread Duy Nguyen
On Mon, Apr 17, 2017 at 6:36 PM, Urs Thuermann wrote: > Sometimes I need to rename and change a file in one commit. One > example would be a file foo.h that begins with > > #ifndef FOO_H > #define FOO_H > > which should be renamed bar.h and have the FOO_H changed

Re: [PATCH 3/3] reset.c: update files when using sparse to avoid data loss.

2017-04-17 Thread Duy Nguyen
On Sun, Apr 16, 2017 at 11:25 AM, Duy Nguyen <pclo...@gmail.com> wrote: >> Because this is a reset --mixed it will never run through unpack_trees and >> The entries are never marked with CE_REMOVE. > > I know. But in my view, it should. All updates from a tree object to &

Re: [PATCH] Make git log work for git CWD outside of work tree

2017-04-17 Thread Duy Nguyen
On Fri, Apr 14, 2017 at 4:29 AM, Jeff King <p...@peff.net> wrote: > On Wed, Apr 12, 2017 at 08:11:22PM +0700, Duy Nguyen wrote: > >> On Wed, Apr 12, 2017 at 8:01 PM, Jeff King <p...@peff.net> wrote: >> > I dunno. Maybe I am missing some subtle case, but it's n

Re: [PATCH 2/2] config: handle conditional include when $GIT_DIR is not set up

2017-04-17 Thread Duy Nguyen
(To Junio, this series conflicts slightly with nd/conditional-config-include, let me know if you want me to rebase this on top of that) On Sun, Apr 16, 2017 at 10:51 PM, Jeff King wrote: >> + if (opts.git_dir) { >> struct git_config_source repo_config; >> >>

  1   2   3   4   5   6   7   8   9   10   >