Re: git work trees

2017-04-12 Thread Duy Nguyen
On Tue, Apr 11, 2017 at 10:14 PM, taylor, david wrote: > We are using Git in a distributed environment. > > In the United States, we have the master repository in one state and a build > cluster in a different state. > In addition to people in the US doing builds, we have people in other > count

Re: [PATCH v4 0/5] Kill manual ref parsing code in worktree.c

2017-04-14 Thread Duy Nguyen
On Thu, Apr 13, 2017 at 07:02:22PM -0700, Junio C Hamano wrote: > Oops, I shouldn't have done that. When applied on top of the > files-backend thing (or have you updated that one and is my tree > lacking it???), this breaks quite a few tests. > > t0001#41 dumps core from "git worktree add ../link

Re: [PATCH] worktree add: add --lock option

2017-04-14 Thread Duy Nguyen
On Fri, Apr 14, 2017 at 5:50 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> As explained in the document. This option has an advantage over the >> command sequence "git worktree add && git worktree lock": there will be >> no gap that somebody can accidentally "prune" the new workt

Re: [PATCH v7 19/28] files-backend: replace submodule_allowed check in files_downcast()

2017-04-14 Thread Duy Nguyen
On Fri, Apr 14, 2017 at 03:44:46AM -0700, Junio C Hamano wrote: > Duy Nguyen writes: > > > I'll mark this mail and do a follow-up patch once this topic graduates > > to master. It's less review burden and mail traffic. > > I actually do not mind a single repl

Re: [PATCH] worktree add: add --lock option

2017-04-15 Thread Duy Nguyen
On Sat, Apr 15, 2017 at 3:07 PM, Junio C Hamano wrote: > Junio C Hamano writes: > >> Nguyễn Thái Ngọc Duy writes: >> >>> -unlink_or_warn(sb.buf); >>> +if (!ret && opts->keep_locked) { >>> +/* >>> + * Don't keep the confusing "initializing" message >>> +

Re: includeIf breaks calling dashed externals

2017-04-15 Thread Duy Nguyen
On Fri, Apr 14, 2017 at 01:43:37PM -0400, Jeff King wrote: > On Fri, Apr 14, 2017 at 07:04:23PM +0200, Bert Wesarg wrote: > > > Dear Duy, > > > > heaving an includeIf in a git config file breaks calling external git > > commands, most prominently git-gui. > > > > $ git --version > > git version

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

2017-04-15 Thread Duy Nguyen
On Wed, Apr 12, 2017 at 10:37 PM, Kevin Willford wrote: > >> -Original Message- >> From: git-ow...@vger.kernel.org [mailto:git-ow...@vger.kernel.org] On >> Behalf Of Duy Nguyen >> Sent: Wednesday, April 12, 2017 7:21 AM >> To: Kevin Willford >> C

Re: What's cooking in git.git (Apr 2017, #02; draft as of Sat, 15)

2017-04-16 Thread Duy Nguyen
On Sat, Apr 15, 2017 at 5:14 PM, Junio C Hamano wrote: > * nd/conditional-config-include (2017-04-14) 2 commits > - config: resolve symlinks in conditional include's patterns > - path.c: and an option to call real_path() in expand_user_path() > $GIT_DIR may in some cases be normalized with all

Re: [BUG] ls-files '**' globstar matches one or more directories instead of zero or more directories

2017-04-16 Thread Duy Nguyen
On Sat, Apr 15, 2017 at 2:17 AM, Alistair Buxton wrote: > To reproduce, go to any git repository and run: > > diff <(git ls-files '**/*' | sort) <(git ls-files | sort) > > Expected result: No output since both commands should produce identical > output. > > Actual result: '**/*' only matches

Re: [BUG] ls-files '**' globstar matches one or more directories instead of zero or more directories

2017-04-16 Thread Duy Nguyen
On Sat, Apr 15, 2017 at 2:17 AM, Alistair Buxton wrote: > To reproduce, go to any git repository and run: > > diff <(git ls-files '**/*' | sort) <(git ls-files | sort) Actually the '**/' magic only kicks in if you write git ls-files ':(glob)**/*' Without that '**' is a normal '*' and matchi

Re: [PATCH 1/2] config: prepare to pass more info in git_config_with_options()

2017-04-16 Thread Duy Nguyen
On Sun, Apr 16, 2017 at 11:31:28AM -0400, Jeff King wrote: > On Sun, Apr 16, 2017 at 05:41:24PM +0700, Nguyễn Thái Ngọc Duy wrote: > > > So far we can only pass one flag, respect_includes, to thie function. We > > need to pass some more (non-flag even), so let's make it accept a struct > > instead

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

2017-04-16 Thread Duy Nguyen
On Sun, Apr 16, 2017 at 11:51:32AM -0400, Jeff King wrote: > > diff --git a/cache.h b/cache.h > > index e29a093839..27b7286f99 100644 > > --- a/cache.h > > +++ b/cache.h > > @@ -1884,6 +1884,8 @@ enum config_origin_type { > > > > struct config_options { > > unsigned int respect_includes : 1;

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; >> >> memset

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 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 wrote: >> > I dunno. Maybe I am missing some subtle case, but it's not clear to me >> > what the u

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 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 > the index should happen

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 to BAR_H. > In subversion

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? > > Example maybe I wan

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: [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 >> @@ -179,6 +179,14 @@

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 *r

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 loc

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 ref_store *refs

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 functions entirely. >>

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: >>> >>> http://public-inbox.org/git/20170330210354.20018-1-chrisc...@tuxfamily.org/ >> >> Yea

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. Perhaps it is trying to read >> > an

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 wrote: > On Fri, Apr 21, 2017 at 1:46 PM, Christian Couder > wrote: >> On Fri, Apr 21, 2017 at 11:53 AM, Duy Nguyen wrote: >>> On Fri, Apr 21, 2017 at 2:10 PM, Christian Couder >>> wrote: >>>> On Thu,

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: [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 deletions(-) >> >> diff --git a/refs.c b/re

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: 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 me. > > OTOH, format=

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, > 2013-08-27) so tha

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)) { >> + /* >> + * Main w

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: [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 initially >> added. >> >> There was concern at

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 support for ** in globs

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 document the differenc

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: 'refs*master' does not appear to be a

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 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 >> > we should be worried about?

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 the #define of the >> other. >> >> In the

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, really useful. > > But. One innocu

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 (probably 'pu') and the build fai

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. >> >> t5512 needs update becaus

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 introduced. The >> >latter's name is probably not great...

Re: [PATCH] run-command: use strbuf_addstr() for adding a string to a strbuf

2018-03-25 Thread Duy Nguyen
On Sun, Mar 25, 2018 at 12:57 PM, René Scharfe wrote: > Patch generated with Coccinelle and contrib/coccinelle/strbuf.cocci. > > Signed-off-by: Rene Scharfe > --- > That line was added by e73dd78699 (run-command.c: introduce > trace_run_command()). > > run-command.c | 2 +- > 1 file changed, 1 i

Re: [PATCH v7 00/13] nd/pack-objects-pack-struct updates

2018-03-26 Thread Duy Nguyen
On Mon, Mar 26, 2018 at 5:13 PM, Jeff King wrote: > On Sat, Mar 24, 2018 at 07:33:40AM +0100, Nguyễn Thái Ngọc Duy wrote: > >> +unsigned long oe_get_size_slow(struct packing_data *pack, >> +const struct object_entry *e) >> +{ >> + struct packed_git *p; >> + stru

Re: [PATCH v2 01/36] t/helper: add an empty test-tool program

2018-03-26 Thread Duy Nguyen
On Mon, Mar 26, 2018 at 5:27 PM, Johannes Schindelin wrote: > Hi Duy, > > On Sat, 24 Mar 2018, Nguyễn Thái Ngọc Duy wrote: > >> diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c >> new file mode 100644 >> index 00..c730f718ca >> --- /dev/null >> +++ b/t/helper/test-tool.c >> @@ -0,0

Re: git complains packed-refs is not a directory when used with GIT_DIR and GIT_WORK_TREE envvars.

2018-03-27 Thread Duy Nguyen
On Tue, Mar 27, 2018 at 8:31 AM, Jeff King wrote: >... > > But that really feels like we're papering over the problem. It is papering over the problem in my opinion. setup_work_tree() is involved here and when it moves cwd around, it re-init git-dir (and all other paths). Before my patch we call

Re: [PATCH v2] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-27 Thread Duy Nguyen
On Tue, Mar 27, 2018 at 12:02 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> The set of extra warnings we enable when DEVELOPER has to be >> conservative because we can't assume any compiler version the >> developer may use. Detect the compiler version so we know when it's >> safe

Re: [PATCH v6 07/35] connect: convert get_remote_heads to use struct packet_reader

2018-03-27 Thread Duy Nguyen
On Thu, Mar 15, 2018 at 10:31:14AM -0700, Brandon Williams wrote: > In order to allow for better control flow when protocol_v2 is introduced > +static enum protocol_version discover_version(struct packet_reader *reader) > +{ > + enum protocol_version version = protocol_unknown_version; > + > +

Re: [PATCH v6 07/35] connect: convert get_remote_heads to use struct packet_reader

2018-03-27 Thread Duy Nguyen
On Tue, Mar 27, 2018 at 6:11 PM, Jeff King wrote: > On Tue, Mar 27, 2018 at 05:27:14PM +0200, Duy Nguyen wrote: > >> On Thu, Mar 15, 2018 at 10:31:14AM -0700, Brandon Williams wrote: >> > In order to allow for better control flow when protocol_v2 is introduced >> >

Re: [PATCH v6 07/35] connect: convert get_remote_heads to use struct packet_reader

2018-03-27 Thread Duy Nguyen
On Tue, Mar 27, 2018 at 6:25 PM, Duy Nguyen wrote: > On Tue, Mar 27, 2018 at 6:11 PM, Jeff King wrote: >> On Tue, Mar 27, 2018 at 05:27:14PM +0200, Duy Nguyen wrote: >> >>> On Thu, Mar 15, 2018 at 10:31:14AM -0700, Brandon Williams wrote: >>> > In order t

Re: git complains packed-refs is not a directory when used with GIT_DIR and GIT_WORK_TREE envvars.

2018-03-27 Thread Duy Nguyen
On Tue, Mar 27, 2018 at 6:47 PM, Jeff King wrote: >> So I would not mind papering over it right now (with an understanding >> that absolute path pays some more overhead in path walking, which was >> th reason we tried to avoid it in setup code). A slightly better patch >> is trigger this path abso

Re: git complains packed-refs is not a directory when used with GIT_DIR and GIT_WORK_TREE envvars.

2018-03-27 Thread Duy Nguyen
On Tue, Mar 27, 2018 at 07:09:36PM +0200, Duy Nguyen wrote: > I would rather have something like ref_store_reinit() in the same > spirit as the second call of set_git_dir() in setup_work_tree. It is > hacky, but it works and keeps changes to minimal (so that it could be > easily re

Re: git complains packed-refs is not a directory when used with GIT_DIR and GIT_WORK_TREE envvars.

2018-03-28 Thread Duy Nguyen
On Wed, Mar 28, 2018 at 11:52 AM, Jeff King wrote: > On Tue, Mar 27, 2018 at 07:30:24PM +0200, Duy Nguyen wrote: > >> On Tue, Mar 27, 2018 at 07:09:36PM +0200, Duy Nguyen wrote: >> > I would rather have something like ref_store_reinit() in the same >> > spirit as

Re: [PATCH 2/8] strbuf.c: reintroduce get_pwd_cwd() (with strbuf_ prefix)

2018-03-28 Thread Duy Nguyen
On Wed, Mar 28, 2018 at 8:02 PM, Stefan Beller wrote: > On Wed, Mar 28, 2018 at 10:55 AM, Nguyễn Thái Ngọc Duy > wrote: >> +/** >> + * Return the current directory, fall back to $PWD if the >> + * current directory does not exist. >> + */ >> +extern void strbuf_get_pwd_cwd(struct strbuf *sb); > >

Re: [PATCH 6/8] environment.c: adjust env containing relpath when $CWD is moved

2018-03-28 Thread Duy Nguyen
On Wed, Mar 28, 2018 at 8:30 PM, Jeff King wrote: > On Wed, Mar 28, 2018 at 07:55:35PM +0200, Nguyễn Thái Ngọc Duy wrote: > >> From: Duy Nguyen >> >> As noted in the previous patch, when $CWD is moved, we recognize the >> problem with relative paths and update $GIT_

Re: [PATCH 2/4] add chdir-notify API

2018-03-29 Thread Duy Nguyen
On Wed, Mar 28, 2018 at 7:40 PM, Jeff King wrote: > +static void reparent_cb(const char *old_cwd, > + const char *new_cwd, > + void *data) > +{ > + char **path = data; Maybe check data == NULL and return early. This is just for convenience, e.g. i

Re: [PATCH 0/8] Re: git complains packed-refs is not a directory when used with GIT_DIR and GIT_WORK_TREE envvars.

2018-03-29 Thread Duy Nguyen
On Wed, Mar 28, 2018 at 02:19:32PM -0400, Jeff King wrote: > > > I will probably rework on top of your chdir-notify instead (and let > > yours to be merged earlier) > > Thanks. I like some of the related changes you made, like including this > in the tracing output. That should be easy to do on t

Re: [PATCH 3/4] set_work_tree: use chdir_notify

2018-03-29 Thread Duy Nguyen
On Wed, Mar 28, 2018 at 7:42 PM, Jeff King wrote: > When we change to the top of the working tree, we manually > re-adjust $GIT_DIR and call set_git_dir() again, in order to > update any relative git-dir we'd compute earlier. Another way to approach this problem is not delaying chdir() at all. We

Re: [PATCH 3/4] set_work_tree: use chdir_notify

2018-03-29 Thread Duy Nguyen
On Thu, Mar 29, 2018 at 7:02 PM, Duy Nguyen wrote: > ... > > It's less code this way, but it uses up more of your (or my) time > because even though the first set_git_dir() call actually happens at 8 > places. Is it worth trying ? Never mind. I took a stab anyway. The setup c

Re: [PATCH 3/4] set_work_tree: use chdir_notify

2018-03-29 Thread Duy Nguyen
On Thu, Mar 29, 2018 at 7:50 PM, Jeff King wrote: > On Thu, Mar 29, 2018 at 07:02:21PM +0200, Duy Nguyen wrote: > >> On Wed, Mar 28, 2018 at 7:42 PM, Jeff King wrote: >> > When we change to the top of the working tree, we manually >> > re-adjust $GIT_DIR and call se

Re: [PATCH 2/4] add chdir-notify API

2018-03-29 Thread Duy Nguyen
On Thu, Mar 29, 2018 at 7:48 PM, Jeff King wrote: > On Thu, Mar 29, 2018 at 04:53:42PM +0200, Duy Nguyen wrote: > >> On Wed, Mar 28, 2018 at 7:40 PM, Jeff King wrote: >> > +static void reparent_cb(const char *old_cwd, >> > +

Re: [PATCH 1/9] git_config_set: fix off-by-two

2018-03-30 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 2:32 PM, Johannes Schindelin wrote: > Hi, > > On Thu, 29 Mar 2018, Jeff King wrote: > >> On Thu, Mar 29, 2018 at 11:15:33AM -0700, Stefan Beller wrote: >> >> > > When calling `git config --unset abc.a` on this file, it leaves this >> > > (invalid) config behind: >> > > >> >

Re: [PATCH] setup.c: reset candidate->work_tree after freeing it

2018-03-30 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 7:10 PM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> Dangling pointers are usually bad news. Reset it back to NULL. >> >> Signed-off-by: Nguyễn Thái Ngọc Duy >> --- > > Before abade65b ("setup: expose enumerated repo info", 2017-11-12), > candidate was an o

Re: [PATCH] setup.c: reset candidate->work_tree after freeing it

2018-03-30 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 8:32 PM, Junio C Hamano wrote: > Duy Nguyen writes: > >> On Fri, Mar 30, 2018 at 7:10 PM, Junio C Hamano wrote: >> >>> Which fields in candidate are safe to peek by the caller? How can a >>> caller tell? >>

Re: [PATCH 1/9] git_config_set: fix off-by-two

2018-03-30 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 8:53 PM, Johannes Schindelin wrote: > I think the best course of action would be to incrementally do away with > the shell scripted test framework, in the way you outlined earlier this > year. This would *also* buy us a wealth of other benefits, such as better > control ove

Re: [PATCH v2 0/5] re-parenting relative directories after chdir

2018-03-30 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 02:34:25PM -0400, Jeff King wrote: > On Wed, Mar 28, 2018 at 01:36:56PM -0400, Jeff King wrote: > > > For those just joining us, this fixes a regression that was in v2.13 (so > > nothing we need to worry about as part of the 2.17-rc track). > > > > [1/4]: set_git_dir: di

Re: [PATCH v7 13/13] pack-objects: reorder members to shrink struct object_entry

2018-03-30 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 11:26 PM, Jeff King wrote: > On Sat, Mar 24, 2018 at 07:33:53AM +0100, Nguyễn Thái Ngọc Duy wrote: > >> Previous patches leave lots of holes and padding in this struct. This >> patch reorders the members and shrinks the struct down to 80 bytes >> (from 136 bytes, before any

Re: [PATCH v7 12/13] pack-objects: shrink delta_size field in struct object_entry

2018-03-30 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 11:24 PM, Jeff King wrote: > On Sat, Mar 24, 2018 at 07:33:52AM +0100, Nguyễn Thái Ngọc Duy wrote: >> @@ -2004,10 +2006,12 @@ static int try_delta(struct unpacked *trg, struct >> unpacked *src, >> delta_buf = create_delta(src->index, trg->data, trg_size, &delta_size,

Re: [PATCH v7 10/13] pack-objects: clarify the use of object_entry::size

2018-03-30 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 11:04 PM, Jeff King wrote: > The subject says "clarify" so I was a little surprised to see code > changes. It looks like we're just avoiding reassigning on top of the > value repeatedly, which is part of that clarification. It looks like a > noop to me. Oh well... I was co

Re: [PATCH v7 08/13] pack-objects: shrink z_delta_size field in struct object_entry

2018-03-30 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 10:59 PM, Jeff King wrote: > On Sat, Mar 24, 2018 at 07:33:48AM +0100, Nguyễn Thái Ngọc Duy wrote: > >> We only cache deltas when it's smaller than a certain limit. This limit >> defaults to 1000 but save its compressed length in a 64-bit field. >> Shrink that field down to

Re: [PATCH v7 06/13] pack-objects: move in_pack out of struct object_entry

2018-03-30 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 10:48 PM, Jeff King wrote: > On Sat, Mar 24, 2018 at 07:33:46AM +0100, Nguyễn Thái Ngọc Duy wrote: > >> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c >> index e1244918a5..b41610569e 100644 >> --- a/builtin/pack-objects.c >> +++ b/builtin/pack-objects.c >> @@

Re: [PATCH v7 12/13] pack-objects: shrink delta_size field in struct object_entry

2018-03-31 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 11:24 PM, Jeff King wrote: > How come this doesn't get a pdata->oe_delta_size_limit like we have > pdata->oe_size_limit? Would we want a matching > $GIT_TEST_OE_DELTA_SIZE_BITS to test it, too? Nope. This changes how the delta chain is formed (e.g. produces shorter chains)

Re: What's cooking in git.git (Mar 2018, #06; Fri, 30)

2018-03-31 Thread Duy Nguyen
On Fri, Mar 30, 2018 at 10:38 PM, Junio C Hamano wrote: > * nd/repack-keep-pack (2018-03-26) 7 commits > - pack-objects: show some progress when counting kept objects > - gc --auto: exclude base pack if not enough mem to "repack -ad" > - gc: handle a corner case in gc.bigPackThreshold > - gc:

Re: [PATCH v7 06/13] pack-objects: move in_pack out of struct object_entry

2018-03-31 Thread Duy Nguyen
On Sat, Mar 31, 2018 at 06:20:07AM -0400, Jeff King wrote: > On Sat, Mar 31, 2018 at 06:51:10AM +0200, Duy Nguyen wrote: > > > >> +#define IN_PACK(obj) oe_in_pack(&to_pack, obj) > > > > > > How come this one gets a macro, but the earlier conversions don&#x

Re: [PATCH v8 00/15] nd/pack-objects-pack-struct updates

2018-03-31 Thread Duy Nguyen
On Sat, Mar 31, 2018 at 1:36 PM, Ævar Arnfjörð Bjarmason wrote: >> +GIT_TEST_SPLIT_INDEX forces split-index mode on the whole test suite. >> + >> GIT_TEST_FULL_IN_PACK_ARRAY exercises the uncommon pack-objects code >> path where there are more than 1024 packs even if the actual number of >> pac

Re: [PATCH 4/3] Makefile: untangle DEVELOPER and -Werror

2018-03-31 Thread Duy Nguyen
On Sat, Mar 31, 2018 at 6:40 PM, Ævar Arnfjörð Bjarmason wrote: > Change the DEVELOPER flag, and the newly added EAGER_DEVELOPER flag > which (approximately) enables -Wextra so that any combination of them > and -Werror can be set. > > I've long wanted to use DEVELOPER=1 in my production builds, b

Re: [PATCH 4/3] Makefile: untangle DEVELOPER and -Werror

2018-04-03 Thread Duy Nguyen
On Tue, Apr 03, 2018 at 11:19:46AM +0200, Ævar Arnfjörð Bjarmason wrote: > > On Sat, Mar 31 2018, Duy Nguyen wrote: > > > On Sat, Mar 31, 2018 at 6:40 PM, Ævar Arnfjörð Bjarmason > > wrote: > >> Change the DEVELOPER flag, and the newly added EAGER_DEVELOPER

Re: [PATCH] t2028: tighten grep expression to make "move worktree" test more robust

2018-04-03 Thread Duy Nguyen
On Tue, Apr 3, 2018 at 11:25 AM, Eric Sunshine wrote: > Following a rename of worktree "source" to "destination", the "move > worktree" test uses grep to verify that the output of "git worktree list > --porcelain" does not contain "source" (and does contain "destination"). > Unfortunately, the gre

Re: [PATCH 1/9] git_config_set: fix off-by-two

2018-04-03 Thread Duy Nguyen
On Tue, Apr 3, 2018 at 11:31 AM, Johannes Schindelin wrote: > It is very frustrating to spend that much time with only little gains here > and there (and BusyBox-w32 is simply not robust enough yet, apart from > also not showing a significant improvement in performance). You still use busybox-w32

Re: [RFC PATCH 00/19] object-store refactoring 3 (replace objects, main ref store)

2018-04-07 Thread Duy Nguyen
On Sat, Apr 7, 2018 at 1:21 AM, Stefan Beller wrote: * > diff --git a/repository.h b/repository.h > index 09df94a472..2922d3a28b 100644 > --- a/repository.h > +++ b/repository.h > @@ -26,6 +26,11 @@ struct repository { > */ > struct raw_object_store *objects; > > + /* >

Re: [PATCH 4/3] Makefile: untangle DEVELOPER and -Werror

2018-04-07 Thread Duy Nguyen
On Fri, Apr 6, 2018 at 11:42 PM, Jeff King wrote: > On Tue, Apr 03, 2018 at 05:17:00PM +0200, Duy Nguyen wrote: > >> It's not that complex. With the EAGER_DEVELOPER patch removed, we can >> have something like this where eager devs just need to put >> >>

Re: [PATCH 4/3] Makefile: untangle DEVELOPER and -Werror

2018-04-07 Thread Duy Nguyen
On Sat, Apr 7, 2018 at 2:36 PM, Ævar Arnfjörð Bjarmason wrote: > Anyway, I see you've pushed a new version with DEVOPTS. I'll submit mine > on top of that once your new version lands (unless you want to try to > integrate it yourself). Actually I think I'll just drop both EAGER_DEVELOPER and DEVO

Re: [PATCH/RFC 5/5] help: add "-a --verbose" to list all commands with synopsis

2018-04-09 Thread Duy Nguyen
On Mon, Apr 9, 2018 at 11:55 AM, Eric Sunshine wrote: > On Mon, Apr 9, 2018 at 5:47 AM, Junio C Hamano wrote: >> Eric Sunshine writes: >>> On Mon, Mar 26, 2018 at 12:55 PM, Nguyễn Thái Ngọc Duy >>> wrote: + switch (category) { + case CAT_ancillaryinterrogators: return _("A

Re: What's cooking in git.git (Apr 2018, #01; Mon, 9)

2018-04-09 Thread Duy Nguyen
On Mon, Apr 9, 2018 at 12:21 PM, Junio C Hamano wrote: > * sb/packfiles-in-repository (2018-03-26) 12 commits > (merged to 'next' on 2018-03-30 at caa68db14d) > + packfile: keep prepare_packed_git() private > + packfile: allow find_pack_entry to handle arbitrary repositories > + packfile: add

Re: [PATCH 1/2] git-worktree.txt: recommend 'git worktree remove' over manual deletion

2018-04-09 Thread Duy Nguyen
On Mon, Apr 9, 2018 at 9:33 AM, Eric Sunshine wrote: > When cc73385cf6 (worktree remove: new command, 2018-02-12) implemented > and documented 'git worktree remove', it forgot to update existing > instructions suggesting manual deletion. Fix this oversight by > recommending 'git worktree remove' i

Re: [PATCH/RFC 3/5] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-09 Thread Duy Nguyen
On Mon, Apr 9, 2018 at 6:59 AM, Eric Sunshine wrote: > On Mon, Mar 26, 2018 at 12:55 PM, Nguyễn Thái Ngọc Duy > wrote: >> common-cmds.h is used to extract the list of common commands (by >> group) and a one-line summary of each command. Some information is >> dropped, for example command category

Re: [PATCH/RFC 0/5] Keep all info in command-list.txt in git binary

2018-04-14 Thread Duy Nguyen
On Thu, Apr 12, 2018 at 12:06 AM, Philip Oakley wrote: > I'm only just catching up, but does/can this series also capture the > non-command guides that are available in git so that the 'git help -g' can > begin to list them all? It currently does not. But I don't see why it should not. This shoul

Re: [PATCH v1 0/2] fsexcludes: Add programmatic way to exclude files

2018-04-14 Thread Duy Nguyen
On Tue, Apr 10, 2018 at 11:04 PM, Ben Peart wrote: > In git repos with large working directories an external file system monitor > (like fsmonitor or gvfs) can track what files in the working directory have > been > modified. This information can be used to speed up git operations that scale > b

Re: [PATCH/RFC 3/5] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-15 Thread Duy Nguyen
On Mon, Apr 9, 2018 at 6:59 AM, Eric Sunshine wrote: >> +awk '{print $2;}' | > > At one time, Junio expressed concerns[2] about having an 'awk' > dependency in the build system (in fact, with regards to this same > generation process). Whether he still has such concerns is unknown, > but it should

Re: .gitattributes lookup doesn't respect GIT_WORK_TREE

2018-04-16 Thread Duy Nguyen
On Mon, Apr 16, 2018 at 12:40 AM, Andreas Schwab wrote: > On Apr 16 2018, Junio C Hamano wrote: > >> I may be mistaken (I do not have the code in front of me right now) >> but IIRC after the setup.c code runs (which happens quite early in >> the sequence that starts from git.c::cmd_main()), the G

Re: [PATCH v2 3/6] generate-cmdlist.sh: keep all information in common-cmds.h

2018-04-16 Thread Duy Nguyen
On Mon, Apr 16, 2018 at 8:28 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> @@ -23,28 +36,44 @@ sed -n ' >> ' "$1" >> printf '};\n\n' >> >> +echo "#define GROUP_NONE 0xff /* no common group */" > > Some later code forgets about this value, and causes "git" to > segfault at

Re: [PATCH/RFC 0/5] Keep all info in command-list.txt in git binary

2018-04-17 Thread Duy Nguyen
On Sun, Apr 15, 2018 at 11:21 PM, Philip Oakley wrote: > From: "Duy Nguyen" : Saturday, April 14, 2018 4:44 PM > >> On Thu, Apr 12, 2018 at 12:06 AM, Philip Oakley >> wrote: >>> >>> I'm only just catching up, but does/can this series also captu

Re: [PATCH/RFC 0/5] Keep all info in command-list.txt in git binary

2018-04-17 Thread Duy Nguyen
On Tue, Apr 17, 2018 at 06:24:41PM +0200, Duy Nguyen wrote: > On Sun, Apr 15, 2018 at 11:21 PM, Philip Oakley wrote: > > From: "Duy Nguyen" : Saturday, April 14, 2018 4:44 PM > > > >> On Thu, Apr 12, 2018 at 12:06 AM, Philip Oakley > >> wrote: > >

Re: [PATCH/RFC] completion: complete all possible -no-

2018-04-18 Thread Duy Nguyen
On Wed, Apr 18, 2018 at 5:43 AM, Junio C Hamano wrote: > So, the earlier mention of "clone --no-checkout" sounded about not > losing this historical practice, but (desirabilty of magic number 4 > aside) this "show first handful of --no-foo" feature is not about > historical practice but is forward

Re: [PATCH/RFC 0/5] Keep all info in command-list.txt in git binary

2018-04-18 Thread Duy Nguyen
On Wed, Apr 18, 2018 at 12:47 AM, Philip Oakley wrote: >>> > Is that something I should add to my todo to add a 'guide' category > >>> > etc.? >>> >>> I added it too [1]. Not sure if you want anything more on top though. > > > What I've seen is looking good - I've not had as much time as I'd like.

Re: [PATCH v2 1/2] completion: stop showing 'save' for stash by default

2018-04-19 Thread Duy Nguyen
On Fri, Apr 20, 2018 at 1:25 AM, Thomas Gummerer wrote: > The 'save' subcommand in git stash has been deprecated in > fd2ebf14db ("stash: mark "git stash save" deprecated in the man page", > 2017-10-22). > > Stop showing it when the users enters 'git stash ' or 'git stash > s'. Keep showing it ho

Re: [PATCH v3 0/6] Keep all info in command-list.txt in git binary

2018-04-21 Thread Duy Nguyen
On Sat, Apr 21, 2018 at 06:54:08PM +0200, Nguyễn Thái Ngọc Duy wrote: > Changes: > > - remove the deprecated column in command-list.txt. My change break it > anyway if anyone uses it. > - fix up failed tests that I marked in the RFC and kinda forgot about it. > - fix bashisms in generate-cmdlist

Re: [RFC PATCH v10 32.5/36] unpack_trees: fix memory corruption with split_index when src != dst

2018-04-22 Thread Duy Nguyen
On Sat, Apr 21, 2018 at 9:37 PM, Elijah Newren wrote: > Currently, all callers of unpack_trees() set o->src_index == o->dst_index. > Since we create a temporary index in o->result, then discard o->dst_index > and overwrite it with o->result, when o->src_index == o->dst_index it is > safe to just r

Re: [PATCH v3 0/6] Keep all info in command-list.txt in git binary

2018-04-22 Thread Duy Nguyen
On Sun, Apr 22, 2018 at 4:45 PM, Ramsay Jones wrote: > > > On 21/04/18 17:56, Duy Nguyen wrote: >> On Sat, Apr 21, 2018 at 06:54:08PM +0200, Nguyễn Thái Ngọc Duy wrote: >>> Changes: >>> >>> - remove the deprecated column in command-list.txt. My chan

<    1   2   3   4   5   6   7   8   9   10   >