Re: t1503 broken ?

2017-03-25 Thread Duy Nguyen
On Sat, Mar 25, 2017 at 5:46 PM, Torsten Bögershausen wrote: > ./t1305-config-include.sh > seems to be broken: > not ok 19 - conditional include, $HOME expansion > not ok 21 - conditional include, relative path let me guess, your "git" directory is in a symlink path? -- Duy

Re: [PATCH v6 24/27] t/helper: add test-ref-store to test ref-store functions

2017-03-25 Thread Duy Nguyen
On Wed, Mar 22, 2017 at 8:37 PM, Jeff King wrote: > On Wed, Mar 22, 2017 at 09:34:12AM -0400, Jeff King wrote: > >> On Sat, Mar 18, 2017 at 09:03:34AM +0700, Nguyễn Thái Ngọc Duy wrote: >> >> > diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c >> > new file mode

Re: [PATCH v2] [GSoC] remove_subtree(): reimplement using iterators

2017-03-25 Thread Duy Nguyen
On Sat, Mar 25, 2017 at 6:27 PM, Daniel Ferreira wrote: > Use dir_iterator to traverse through remove_subtree()'s directory tree, > avoiding the need for recursive calls to readdir(). Simplify > remove_subtree()'s code. > > A conversion similar in purpose was previously done at

Re: [PATCH v3 3/5] grep: fix bug when recursing with relative pathspec

2017-03-21 Thread Duy Nguyen
On Sat, Mar 18, 2017 at 12:22 AM, Brandon Williams wrote: > With these two pieces of information a child process can correctly > interpret the pathspecs provided by the user as well as being able to > properly format its output relative to the directory the user invoked > the

Re: [PATCH v3 0/2] bringing attributes to pathspecs

2017-03-21 Thread Duy Nguyen
On Tue, Mar 14, 2017 at 1:23 AM, Brandon Williams wrote: > v3 fixes some nits in style in the test script (using <<-\EOF instead of > <<-EOF) > as well as fixing a few other minor things reported by Junio and Jonathan. I'm slowly digging through the pile of mails in the past

Re: [PATCH] Documentation/git-worktree: use working tree for trees on the file system

2017-03-21 Thread Duy Nguyen
On Tue, Mar 21, 2017 at 1:50 AM, Jonathan Nieder wrote: > Junio C Hamano wrote: >> Stefan Beller writes: > >>> While it may be true that you can have bare worktrees; I would question >>> why anyone wants to do this, as the only thing it provides is an >>>

Re: [PATCH 06/20] builtin/receive-pack: convert portions to struct object_id

2017-03-21 Thread Duy Nguyen
On Tue, Mar 21, 2017 at 6:17 AM, brian m. carlson <sand...@crustytoothpaste.net> wrote: > On Mon, Mar 20, 2017 at 07:56:17PM +0700, Duy Nguyen wrote: >> On Sun, Mar 19, 2017 at 4:19 AM, brian m. carlson >> <sand...@crustytoothpaste.net> wrote: >> > @@ -1489,

Re: [PATCH 10/20] sha1_name: convert struct disambiguate_state to object_id

2017-03-21 Thread Duy Nguyen
On Tue, Mar 21, 2017 at 5:32 AM, brian m. carlson <sand...@crustytoothpaste.net> wrote: > On Mon, Mar 20, 2017 at 08:07:09PM +0700, Duy Nguyen wrote: >> On Sun, Mar 19, 2017 at 4:19 AM, brian m. carlson >> <sand...@crustytoothpaste.net> wrote: >>

Re: [PATCH 00/20] object_id part 7

2017-03-20 Thread Duy Nguyen
On Sun, Mar 19, 2017 at 4:19 AM, brian m. carlson wrote: > This is part 7 in the continuing transition to use struct object_id. It feels very nice to see many ".hash" and "->hash" go away. Looking forward to seeing you kill sha1 in sha1_file.c, object.c and friends.

Re: [PATCH 10/20] sha1_name: convert struct disambiguate_state to object_id

2017-03-20 Thread Duy Nguyen
On Sun, Mar 19, 2017 at 4:19 AM, brian m. carlson wrote: > @@ -332,7 +332,7 @@ static int init_object_disambiguation(const char *name, > int len, > ds->hex_pfx[i] = c; > if (!(i & 1)) > val <<= 4; > -

Re: [PATCH 06/20] builtin/receive-pack: convert portions to struct object_id

2017-03-20 Thread Duy Nguyen
On Sun, Mar 19, 2017 at 4:19 AM, brian m. carlson wrote: > @@ -1489,23 +1489,24 @@ static struct command **queue_command(struct command > **tail, > const char *line, > int linelen) > { > -

Re: [PATCH v6 16/27] path.c: move some code out of strbuf_git_path_submodule()

2017-03-20 Thread Duy Nguyen
On Mon, Mar 20, 2017 at 3:47 AM, Michael Haggerty wrote: > On 03/18/2017 03:03 AM, Nguyễn Thái Ngọc Duy wrote: >> refs is learning to avoid path rewriting that is done by >> strbuf_git_path_submodule(). Factor out this code so it could be reused >> by refs* > > Is the "*" on

Re: [PATCH v6 17/27] refs: move submodule code out of files-backend.c

2017-03-20 Thread Duy Nguyen
On Mon, Mar 20, 2017 at 4:05 AM, Michael Haggerty wrote: >> [...] >> diff --git a/refs/refs-internal.h b/refs/refs-internal.h >> index f732473e1d..dfa1817929 100644 >> --- a/refs/refs-internal.h >> +++ b/refs/refs-internal.h >> @@ -482,12 +482,11 @@ struct ref_store; >> /*

Re: [PATCH v3 2/4] refs: introduce get_worktree_ref_store()

2017-03-20 Thread Duy Nguyen
On Mon, Mar 20, 2017 at 1:59 PM, Michael Haggerty wrote: > I guess I can hold my nose and accept storing worktree and submodule > `ref_store`s together in a single hashmap Release your nose, I'll add a new hashmap :) But while we're here, what are your thoughts about moving

Re: [PATCH 19/20] Rename sha1_array to oid_array

2017-03-20 Thread Duy Nguyen
On Sun, Mar 19, 2017 at 4:19 AM, brian m. carlson wrote: > Since this structure handles an array of object IDs, rename it to struct > oid_array. Also rename the accessor functions and the initialization > constant. > > This commit was produced mechanically by

Re: Add configuration options for some commonly used command-line options

2017-03-20 Thread Duy Nguyen
On Sun, Mar 19, 2017 at 8:18 PM, brian m. carlson wrote: >> OTOH, we already have almost "enable such or such option by default" >> with aliases. People who always run "git am" with "-3" can write >> >> [alias] >> a3 = am -3 >> >> and just run "git a3". > > I

Re: [PATCH v6 26/27] t1406: new tests for submodule ref store

2017-03-20 Thread Duy Nguyen
On Mon, Mar 20, 2017 at 12:27 PM, Michael Haggerty wrote: > On 03/18/2017 03:03 AM, Nguyễn Thái Ngọc Duy wrote: >> Signed-off-by: Nguyễn Thái Ngọc Duy >> --- >> t/t1406-submodule-ref-store.sh (new +x) | 95 >> + >> 1 file

Re: Add configuration options for some commonly used command-line options

2017-03-20 Thread Duy Nguyen
On Sun, Mar 19, 2017 at 8:43 PM, Ævar Arnfjörð Bjarmason wrote: > On Sun, Mar 19, 2017 at 2:18 PM, brian m. carlson > wrote: >> On Sun, Mar 19, 2017 at 11:15:33AM +0100, Matthieu Moy wrote: >>> I think the main problem is indeed "stop the users

Add configuration options for some commonly used command-line options (Was: [RFH] GSoC 2015 application)

2017-03-19 Thread Duy Nguyen
On Thu, Feb 19, 2015 at 5:32 PM, Matthieu Moy wrote: > +### Add configuration options for some commonly used command-line options > + > +This includes: > + > +* git am -3 > + > +* git am -c > + > +Some people always run the command with these options, and would >

Re: [PATCH v3 1/4] environment.c: fix potential segfault by get_git_common_dir()

2017-03-19 Thread Duy Nguyen
On Sun, Mar 19, 2017 at 12:54 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> setup_git_env() must be called before this function to initialize >> git_common_dir so that it returns a non NULL string. And it must return >> a non NULL string or

Re: [PATCH] rev-parse: match @{u}, @{push} and ^{} case-insensitively

2017-03-19 Thread Duy Nguyen
On Sun, Mar 19, 2017 at 5:34 AM, Ævar Arnfjörð Bjarmason wrote: > diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt > index ba11b9c95e..55bde6ea65 100644 > --- a/Documentation/revisions.txt > +++ b/Documentation/revisions.txt > @@ -96,7 +96,8 @@ some output

Re: GSoC 2017: application open, deadline = February 9, 2017

2017-03-18 Thread Duy Nguyen
On Mon, Jan 23, 2017 at 10:02 PM, Matthieu Moy wrote: > * We need to write the application, i.e. essentially polish and update > the text here: https://git.github.io/SoC-2016-Org-Application/ and > update the list of project ideas and microprojects : >

Re: Bug with .gitignore and branch switching

2017-03-17 Thread Duy Nguyen
On Sat, Mar 18, 2017 at 5:02 AM, Jonathan Nieder wrote: > Junio C Hamano wrote: > >> There is no "untracked but precious" vs "untracked and expendable" >> difference in the current system. An untracked file that matches >> patterns listed in .gitignore is treated as the

Re: [PATCH v5 23/24] t1405: some basic tests on main ref store

2017-03-06 Thread Duy Nguyen
On Fri, Mar 3, 2017 at 11:43 PM, Michael Haggerty wrote: > It's notable that these tests grep around the filesystem, so they won't > be applicable to future refs backends. Of course, "pack-refs" is > intrinsically only applicable to the files backend, so for this test > it's

Re: [PATCH 1/2] config: check if config path is a file before parsing it

2017-03-03 Thread Duy Nguyen
On Fri, Mar 3, 2017 at 5:15 PM, Jeff King wrote: > But I do think option (a) is cleaner. The only trick is that for errno > to be valid, we need to make sure we check ferror() soon after seeing > the EOF return value. I suspect it would work OK in practice for the >

Re: [PATCH 1/2] config: check if config path is a file before parsing it

2017-03-03 Thread Duy Nguyen
On Fri, Mar 3, 2017 at 4:53 PM, Jeff King wrote: > I'm mildly negative on this approach for two reasons: > > 1. It requires doing an _extra_ check anywhere we want to care about > this. So if we care about file/directory confusion, we're going to > sprinkle these

Re: [PATCH v7 0/3] Conditional config include

2017-03-03 Thread Duy Nguyen
On Fri, Mar 03, 2017 at 01:33:29AM -0500, Jeff King wrote: > For those following on the mailing list, there is some discussion at: > > https://github.com/git/git/commit/484f78e46d00c6d35f20058671a8c76bb924fb33 > > I think that is mostly focused around another failing in the > error-handling of

Re: [PATCH v5 07/24] files-backend: add and use files_refname_path()

2017-03-02 Thread Duy Nguyen
On Wed, Mar 1, 2017 at 12:41 AM, Michael Haggerty wrote: > On 02/22/2017 03:04 PM, Nguyễn Thái Ngọc Duy wrote: >> Keep repo-related path handling in one place. This will make it easier >> to add submodule/multiworktree support later. >> >> This automatically adds the "if

Re: [PATCH v5 08/24] files-backend: remove the use of git_path()

2017-03-02 Thread Duy Nguyen
On Wed, Mar 1, 2017 at 12:50 AM, Michael Haggerty wrote: >> @@ -995,7 +998,11 @@ static struct ref_store *files_ref_store_create(const >> char *submodule) >> return ref_store; >> } >> >> - refs->packed_refs_path = git_pathdup("packed-refs"); >> +

Re: [PATCH v5 05/24] files-backend: move "logs/" out of TMP_RENAMED_LOG

2017-03-02 Thread Duy Nguyen
On Wed, Mar 1, 2017 at 12:19 AM, Michael Haggerty wrote: >> @@ -2513,7 +2513,7 @@ static int files_delete_refs(struct ref_store >> *ref_store, >> * IOW, to avoid cross device rename errors, the temporary renamed log must >> * live into logs/refs. >> */ >> -#define

Re: [PATCH v5 24/24] t1406: new tests for submodule ref store

2017-03-02 Thread Duy Nguyen
On Thu, Mar 2, 2017 at 3:16 PM, Michael Haggerty wrote: > The for-each-ref iteration is defined to be sorted by refname, but it's > true that the for-each-reflog order is undefined. Thanks. I'm going to add a few lines about this near for_each_ref and for_each_reflog()

Re: [PATCH v5 04/24] files-backend: convert git_path() to strbuf_git_path()

2017-03-02 Thread Duy Nguyen
On Wed, Mar 1, 2017 at 12:06 AM, Michael Haggerty wrote: >> @@ -2681,13 +2709,19 @@ static int files_rename_ref(struct ref_store >> *ref_store, >> log_all_ref_updates = flag; >> >> rollbacklog: >> - if (logmoved && rename(git_path("logs/%s", newrefname), >>

Re: git status --> Out of memory, realloc failed

2017-03-02 Thread Duy Nguyen
On Thu, Mar 2, 2017 at 3:12 AM, Carsten Fuchs wrote: >>> The repository is tracking about 19000 files which together take 260 MB. >>> The git server version is 2.7.4.1.g5468f9e (Bitbucket) >> >> >> Is your repository publicly accessible? > > > Unfortunately, no. There are

Re: [PATCH v5 24/24] t1406: new tests for submodule ref store

2017-03-01 Thread Duy Nguyen
On Wed, Mar 1, 2017 at 10:11 PM, Michael Haggerty wrote: > By trial and error, I found that the test succeeds if I comment out the > "for_each_reflog()" test. By having that test write its results to > `/tmp` where they won't be deleted, I found that the problem is that the

Re: [PATCH] Put sha1dc on a diet

2017-03-01 Thread Duy Nguyen
On Thu, Mar 2, 2017 at 6:19 AM, Jeff King wrote: > You have to remember that some of the Git for Windows users are doing > horrific things like using repositories with 450MB .git/index files, and > the speed to compute the sha1 during an update is noticeable there. We probably

Re: [PATCH v5 24/24] t1406: new tests for submodule ref store

2017-03-01 Thread Duy Nguyen
On Wed, Mar 1, 2017 at 12:34 AM, Michael Haggerty wrote: > On 02/22/2017 03:04 PM, Nguyễn Thái Ngọc Duy wrote: >> Signed-off-by: Nguyễn Thái Ngọc Duy >> --- >> t/t1406-submodule-ref-store.sh (new +x) | 95 >> + >> 1 file

Re: [PATCH v5 09/24] refs.c: introduce get_main_ref_store()

2017-03-01 Thread Duy Nguyen
On Wed, Mar 1, 2017 at 12:51 AM, Michael Haggerty wrote: > On 02/22/2017 03:04 PM, Nguyễn Thái Ngọc Duy wrote: >> Signed-off-by: Nguyễn Thái Ngọc Duy >> --- >> refs.c | 16 >> 1 file changed, 12 insertions(+), 4 deletions(-) >> >> diff

Re: [PATCH v5 12/24] refs.c: kill register_ref_store(), add register_submodule_ref_store()

2017-03-01 Thread Duy Nguyen
On Wed, Mar 1, 2017 at 1:03 AM, Michael Haggerty wrote: >> struct ref_store *get_ref_store(const char *submodule) >> { >> struct strbuf submodule_sb = STRBUF_INIT; >> @@ -1480,6 +1479,9 @@ struct ref_store *get_ref_store(const char *submodule) >> if

Re: Bug: "git worktree add" Unable to checkout a branch with no local ref

2017-02-28 Thread Duy Nguyen
On Mon, Feb 27, 2017 at 9:22 PM, Alexander Grigoriev wrote: > git version 2.10.2.windows.1: > If a remote branch has never been checked out locally (its ref only exists > in remotes// directory), "git worktree add" command is unable to > check it out by its normal short

Re: [PATCH 1/5] grep: illustrate bug when recursing with relative pathspec

2017-02-26 Thread Duy Nguyen
On Sat, Feb 25, 2017 at 6:50 AM, Brandon Williams wrote: > When using the --recurse-submodules flag with a relative pathspec which > includes "..", an error is produced inside the child process spawned for > a submodule. When creating the pathspec struct in the child, the ".."

Re: [PATCH v6 1/1] config: add conditional include

2017-02-25 Thread Duy Nguyen
On Sat, Feb 25, 2017 at 5:08 AM, Philip Oakley wrote: >> +Conditional includes >> + >> + >> +You can include one config file from another conditionally by setting > > > On first reading I thought this implied you can only have one `includeIf` > within the

Re: [PATCH v6 0/1] Conditional config include

2017-02-24 Thread Duy Nguyen
And sorry for duplicates :P Somehow I managed to --dry-run correctly the first time, then had _two_ 000*.patch in the command line. And send-email happily let me shoot myself in the foot. -- Duy

Re: [PATCH v5 1/1] config: add conditional include

2017-02-24 Thread Duy Nguyen
On Fri, Feb 24, 2017 at 2:59 AM, Junio C Hamano wrote: > The variable is obviously not treated the same way as include.path ;-) > > When includeIf..path variable is set in a > configuration file, the configuration file named by that > variable is included (in a way

Re: SHA1 collisions found

2017-02-24 Thread Duy Nguyen
On Thu, Feb 23, 2017 at 11:43 PM, Joey Hess wrote: > IIRC someone has been working on parameterizing git's SHA1 assumptions > so a repository could eventually use a more secure hash. How far has > that gotten? There are still many "40" constants in git.git HEAD. Michael asked

Re: [PATCH v5 01/24] refs.h: add forward declaration for structs used in this file

2017-02-23 Thread Duy Nguyen
On Thu, Feb 23, 2017 at 1:18 AM, Stefan Beller wrote: > On Wed, Feb 22, 2017 at 6:04 AM, Nguyễn Thái Ngọc Duy > wrote: >> Signed-off-by: Nguyễn Thái Ngọc Duy >> --- >> refs.h | 6 +- >> 1 file changed, 5 insertions(+), 1

Re: [PATCH v2 1/4] delete_ref: accept a reflog message argument

2017-02-23 Thread Duy Nguyen
On Tue, Feb 21, 2017 at 8:10 AM, Kyle Meyer wrote: > diff --git a/refs.h b/refs.h > index 9fbff90e7..5880886a7 100644 > --- a/refs.h > +++ b/refs.h > @@ -276,8 +276,8 @@ int reflog_exists(const char *refname); > * exists, regardless of its old value. It is an error for old_sha1

Re: [PATCH v4 14/15] files-backend: remove submodule_allowed from files_downcast()

2017-02-21 Thread Duy Nguyen
On Mon, Feb 20, 2017 at 7:11 PM, Michael Haggerty wrote: > On 02/18/2017 02:33 PM, Nguyễn Thái Ngọc Duy wrote: >> Since submodule or not is irrelevant to files-backend after the last >> patch, remove the parameter from files_downcast() and kill >>

Re: [PATCH v4 00/15] Remove submodule from files-backend.c

2017-02-20 Thread Duy Nguyen
On Mon, Feb 20, 2017 at 7:42 PM, Michael Haggerty wrote: > On 02/18/2017 02:32 PM, Nguyễn Thái Ngọc Duy wrote: >> v4: > > I very much like the direction of this patch series. I reviewed the > design pretty carefully and left some comments about it, and skimmed > through the

Re: [PATCH v4 14/15] files-backend: remove submodule_allowed from files_downcast()

2017-02-20 Thread Duy Nguyen
On Mon, Feb 20, 2017 at 7:30 PM, Michael Haggerty <mhag...@alum.mit.edu> wrote: > On 02/20/2017 01:21 PM, Duy Nguyen wrote: >> On Mon, Feb 20, 2017 at 7:11 PM, Michael Haggerty <mhag...@alum.mit.edu> >> wrote: >>> On 02/18/2017 02:33 PM, Nguyễn Thái

Re: [PATCH v4 06/15] files-backend: remove the use of git_path()

2017-02-20 Thread Duy Nguyen
On Mon, Feb 20, 2017 at 6:34 PM, Michael Haggerty wrote: > On 02/18/2017 02:32 PM, Nguyễn Thái Ngọc Duy wrote: >> Given $GIT_DIR and $GIT_COMMON_DIR, files-backend is now in charge of >> deciding what goes where. The end goal is to pass $GIT_DIR only. A >> refs "view" of a

Re: [PATCH v2 04/16] files-backend: replace *git_path*() with files_path()

2017-02-20 Thread Duy Nguyen
On Mon, Feb 20, 2017 at 6:23 PM, Michael Haggerty wrote: > On 02/16/2017 12:48 PM, Nguyễn Thái Ngọc Duy wrote: >> This centralizes all path rewriting of files-backend.c in one place so >> we have easier time removing the path rewriting later. There could be >> some hidden

Re: [PATCH v4 14/15] files-backend: remove submodule_allowed from files_downcast()

2017-02-20 Thread Duy Nguyen
On Mon, Feb 20, 2017 at 7:11 PM, Michael Haggerty wrote: > On 02/18/2017 02:33 PM, Nguyễn Thái Ngọc Duy wrote: >> Since submodule or not is irrelevant to files-backend after the last >> patch, remove the parameter from files_downcast() and kill >>

Re: [PATCH v2 00/16] Remove submodule from files-backend.c

2017-02-18 Thread Duy Nguyen
On Sat, Feb 18, 2017 at 1:35 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> I'll be sending two more follow-up series, if you are interested, soon: >> >> 1) v2 of nd/worktree-gc-protection >> >> which kills parse_ref() in worktree.c _and_

Re: new git-diff switch to eliminate leading "+" and "-" characters

2017-02-17 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 6:01 AM, Vanderhoof, Tzadik wrote: > The output of git-diff includes lines beginning with "+" and "-" to indicate > added and deleted lines. A somewhat common task (at least for me) is to want > to copy output from a "diff" (usually the

Re: [PATCH v2] clean: use warning_errno() when appropriate

2017-02-14 Thread Duy Nguyen
On Wed, Feb 15, 2017 at 1:13 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> All these warning() calls are preceded by a system call. Report the >> actual error to help the user understand why we fail to remove >> something. >> >>

Re: [PATCH 11/11] refs: split and make get_*_ref_store() public API

2017-02-14 Thread Duy Nguyen
On Wed, Feb 15, 2017 at 1:24 AM, Junio C Hamano <gits...@pobox.com> wrote: > Duy Nguyen <pclo...@gmail.com> writes: > >> Direct call sites are just middle men though, e.g. >> for_each_ref_submodule(). I'll attempt to clean this up at some point >> in future

Re: [PATCH 11/11] refs: split and make get_*_ref_store() public API

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 6:55 AM, Stefan Beller wrote: >> >> +/* >> + * Return the ref_store instance for the specified submodule. For the >> + * main repository, use submodule==NULL; such a call cannot fail. > > So now we have both a get_main as well as a get_submodule

Re: [PATCH 04/11] files-backend: replace *git_path*() with files_path()

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 3:58 AM, Ramsay Jones wrote: >> -void files_path(struct files_ref_store *refs, struct strbuf *sb, >> - const char *fmt, ...) __attribute__((format (printf, 3, 4))); > > You only added this in the last commit, so maybe mark it static

Re: [PATCH 06/11] refs-internal.h: correct is_per_worktree_ref()

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 5:37 AM, Stefan Beller wrote: > On Mon, Feb 13, 2017 at 7:20 AM, Nguyễn Thái Ngọc Duy > wrote: >> All refs outside refs/ directory is per-worktree, not just HEAD. >> >> Signed-off-by: Nguyễn Thái Ngọc Duy >> ---

Re: [PATCH 07/11] files-backend: remove the use of git_path()

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 6:09 AM, Stefan Beller wrote: >> + >> + if (submodule) { >> + refs->submodule = xstrdup_or_null(submodule); > > drop the _or_null here? > > So in this patch we have either > * submodule set > * or gitdir/gitcommondir set > > which

Re: [PATCH 09/11] refs: move submodule code out of files-backend.c

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 6:35 AM, Stefan Beller wrote: >> + git_dir = read_gitfile(buf.buf); > > if buf.buf is a (git) directory as opposed to a git file, > we error out in read_gitfile. Did you mean to use > read_gitfile_gently here or rather even resolve_gitdir_gently ?

Re: [PATCH 01/11] refs-internal.c: make files_log_ref_write() static

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 3:14 AM, Ramsay Jones wrote: > > > On 13/02/17 15:20, Nguyễn Thái Ngọc Duy wrote: >> Created in 5f3c3a4e6f (files_log_ref_write: new function - 2015-11-10) >> but probably never used outside refs-internal.c >> >> Signed-off-by: Nguyễn Thái Ngọc

Re: [PATCH 0/5] Store submodules in a hash, not a linked list

2017-02-12 Thread Duy Nguyen
On Thu, Feb 09, 2017 at 07:40:33PM -0500, Jeff King wrote: > On Thu, Feb 09, 2017 at 10:23:35PM +0100, Michael Haggerty wrote: > > > >> So push the submodule attribute down to the `files_ref_store` class > > >> (but continue to let the `ref_store`s be looked up by submodule). > > > > > > I'm not

Re: Fwd: Possibly nicer pathspec syntax?

2017-02-09 Thread Duy Nguyen
On Thu, Feb 9, 2017 at 4:11 AM, Junio C Hamano wrote: > With or without the patch in this thread, parse_pathspec() behaves > the same way for either CWD or FULL if you feed a non-empty > pathspec with at least one positive element. IOW, if a caller feeds > a non-empty pathspec

Re: Fwd: Possibly nicer pathspec syntax?

2017-02-09 Thread Duy Nguyen
On Thu, Feb 9, 2017 at 12:39 AM, Junio C Hamano <gits...@pobox.com> wrote: > Duy Nguyen <pclo...@gmail.com> writes: > >> On Wed, Feb 8, 2017 at 12:12 PM, Linus Torvalds >> <torva...@linux-foundation.org> wrote: >>> Two-patch series to follow. >&

Re: [PATCH 2/2] worktree.c: use submodule interface to access refs from another worktree

2017-02-09 Thread Duy Nguyen
On Thu, Feb 9, 2017 at 1:07 PM, Michael Haggerty wrote: > It is unquestionably a good goal to avoid parsing references outside of > `refs/files-backend.c`. But I'm not a fan of this approach. Yes. But in this context it was more of a guinea pig. I wanted something simple

Re: Automatically Add .gitignore Files

2017-02-09 Thread Duy Nguyen
On Thu, Feb 9, 2017 at 2:05 AM, Thangalin wrote: > I frequently forget to add .gitignore files when creating new .gitignore > files. > > I'd like to request a command-line option to always add .gitignore > files (or, more generally, always add files that match a given file >

Re: [PATCH] rev-parse --git-path: fix output when running in a subdirectory

2017-02-09 Thread Duy Nguyen
On Wed, Feb 8, 2017 at 7:17 PM, Johannes Schindelin wrote: > In addition to making git_path() aware of certain file names that need > to be handled differently e.g. when running in worktrees, the commit > 557bd833bb (git_path(): be aware of file relocation in $GIT_DIR,

Re: [PATCH 0/2] Demonstrate a critical worktree/gc bug

2017-02-08 Thread Duy Nguyen
On Wed, Feb 8, 2017 at 7:17 PM, Johannes Schindelin wrote: > ... and a half-working workaround for the auto-gc case. > > This patch series really is just another attempt to prod Duy into fixing > this instead of dabbling with shiny new toys ;-) FYI work is ongoing [1]

Re: "disabling bitmap writing, as some objects are not being packed"?

2017-02-08 Thread Duy Nguyen
On Wed, Feb 8, 2017 at 3:24 PM, David Turner <nova...@novalis.org> wrote: > On Wed, 2017-02-08 at 13:45 +0700, Duy Nguyen wrote: >> On Wed, Feb 8, 2017 at 8:03 AM, David Turner <nova...@novalis.org> wrote: >> > On Sat, 2016-12-17 at 14:50 +0700, Duy Nguyen wrote: >

Re: "disabling bitmap writing, as some objects are not being packed"?

2017-02-07 Thread Duy Nguyen
On Wed, Feb 8, 2017 at 8:03 AM, David Turner <nova...@novalis.org> wrote: > On Sat, 2016-12-17 at 14:50 +0700, Duy Nguyen wrote: >> And we can't grep for fatal errors anyway. The problem that led to >> 329e6e8794 was this line >> >> warning: There are too ma

Re: Fwd: Possibly nicer pathspec syntax?

2017-02-07 Thread Duy Nguyen
On Wed, Feb 8, 2017 at 12:12 PM, Linus Torvalds wrote: > Two-patch series to follow. glossary-content.txt update for both patches would be nice. -- Duy

Re: The --name-only option for git log does not play nicely with --graph

2017-02-07 Thread Duy Nguyen
On Wed, Feb 8, 2017 at 6:11 AM, Davide Del Vento wrote: > `git log --graph --name-only` works fine, but the name is not > properly indented as it is for `git log --graph --name-status` > > I tested this in git v1.9.1 the only one I have access at the moment Confirmed still

Re: Request re git status

2017-02-07 Thread Duy Nguyen
On Wed, Feb 8, 2017 at 2:18 AM, Jacob Keller wrote: > Personally, I think that the fact that Git forces the user to think > about it in terms of "oh I have to fetch" instead of that happening > automatically, it helps teach the model to the user. If it happened in > the

Re: [PATCH] dir: avoid allocation in fill_directory()

2017-02-07 Thread Duy Nguyen
On Wed, Feb 8, 2017 at 5:04 AM, René Scharfe wrote: > Pass the match member of the first pathspec item directly to > read_directory() instead of using common_prefix() to duplicate it first, > thus avoiding memory duplication, strlen(3) and free(3). How about killing

Re: The design of refs backends, linked worktrees and submodules

2017-02-07 Thread Duy Nguyen
On Thu, Jan 19, 2017 at 6:55 PM, Duy Nguyen <pclo...@gmail.com> wrote: > I've started working on fixing the "git gc" issue with multiple > worktrees, which brings me back to this. Just some thoughts. Comments > are really appreciated. > > In the current code,

Re: [PATCH] worktree: fix option descriptions for `prune`

2017-02-07 Thread Duy Nguyen
On Tue, Feb 7, 2017 at 1:59 AM, Junio C Hamano wrote: > Patrick Steinhardt writes: > >> struct option options[] = { >> OPT__DRY_RUN(_only, N_("do not remove, show only")), >> - OPT__VERBOSE(, N_("report pruned

Re: git-daemon shallow checkout fail

2017-02-07 Thread Duy Nguyen
On Tue, Feb 7, 2017 at 7:56 AM, Bob Proulx wrote: > Bob Proulx wrote: >> 17:20:40.590177 pkt-line.c:46 packet:clone< >> 34e7202270c381f4e5734180dc19426ce69f2e1e HEAD\0multi_ack thin-pack side-band >> side-band-64k ofs-delta shallow no-progress include-tag

Re: git/git-scm.com GH Issue Tracker

2017-02-06 Thread Duy Nguyen
On Mon, Feb 6, 2017 at 1:15 PM, Samuel Lijin wrote: > # Irrelevant but someone should take a look > > 693 To save people some time (and since i looked at it anyway), this is about whether "warning in tree xxx: contains zero-padded file modes: from fsck should be a warning or

Re: [PATCH/TOY] Shortcuts to quickly refer to a commit name with keyboard

2017-02-05 Thread Duy Nguyen
On Sat, Jan 21, 2017 at 2:16 AM, Jacob Keller wrote: > I would be interested in the code for this.. I'm curious if I can > adapt it to my use of tmux. I stumbled upon this which does mention about git SHA-1. Maybe you'll find it useful. Haven't tried it out though.

Re: Feature request: flagging “volatile” branches for integration/development

2017-02-04 Thread Duy Nguyen
On Wed, Feb 1, 2017 at 12:12 AM, Herbert, Marc wrote: > (Thanks to Josh Triplett[*] for contributing to this message) > > Hi, > > We often work with development/integration branches that regularly > rebase, in addition to stable branches that do not. Git is used to share >

Re: [PATCH v2] reset: add an example of how to split a commit into two

2017-02-04 Thread Duy Nguyen
On Sat, Feb 4, 2017 at 7:16 PM, Philip Oakley <philipoak...@iee.org> wrote: > From: "Duy Nguyen" <pclo...@gmail.com> >> >> On Sat, Feb 4, 2017 at 3:28 AM, Jacob Keller <jacob.e.kel...@intel.com> >> wrote: >>> >>> + &

Re: [PATCH 00/11] nd/worktree-move update

2017-02-04 Thread Duy Nguyen
On Sat, Feb 4, 2017 at 1:25 AM, Junio C Hamano wrote: > Even if you think "the right way" is to add to the iterators, I > suspect that we can still do incremental fixes? I agree with the > order of importance Michael listed in his message (i.e. the index > and the HEAD first,

Re: How to use git show's "%<([,trunc|ltrunc|mtrunc])"?

2017-02-04 Thread Duy Nguyen
On Sat, Feb 4, 2017 at 12:10 AM, Hilco Wijbenga wrote: >>> How do I get "2017-01-31T17:02:13 | Hilco Wijbenga" to be output? >> >> You'll get an ellipsis at the end though.. (i.e. 02:13... | Hilco) > > Indeed, that's not very nice. I suppose I can understand the reason >

Re: [PATCH v2] reset: add an example of how to split a commit into two

2017-02-04 Thread Duy Nguyen
On Sat, Feb 4, 2017 at 3:28 AM, Jacob Keller wrote: > + > +$ git reset HEAD^ <1> It may be a good idea to add -N here, so that 'add -p' can pick up the new files if they are added in HEAD. > +$ git add -p

Re: init --separate-git-dir does not set core.worktree

2017-02-03 Thread Duy Nguyen
On Thu, Feb 2, 2017 at 7:37 PM, Kyle Meyer <k...@kyleam.com> wrote: > Duy Nguyen <pclo...@gmail.com> writes: > >> On Thu, Feb 2, 2017 at 10:55 AM, Kyle Meyer <k...@kyleam.com> wrote: >>> >>> As of 6311cfaf9 (init: do not set unnecessary core.worktre

Re: [PATCH] document behavior of empty color name

2017-02-03 Thread Duy Nguyen
On Thu, Feb 02, 2017 at 01:42:44PM +0100, Jeff King wrote: > On Thu, Feb 02, 2017 at 04:16:15PM +0700, Duy Nguyen wrote: > > > > I hadn't heard anything back, > > > > Sorry I was accidentally busy during Luna new year holiday. > > No problem. That sounds

Re: [PATCH] reset: add an example of how to split a commit into two

2017-02-03 Thread Duy Nguyen
On Fri, Feb 3, 2017 at 7:30 AM, Jacob Keller wrote: > From: Jacob Keller > > It is sometimes useful to break a commit into parts to more logically > show how the code changes. There are many possible ways to achieve this > result, but one simple

Re: [PATCH 00/11] nd/worktree-move update

2017-02-03 Thread Duy Nguyen
On Fri, Feb 3, 2017 at 3:21 AM, Junio C Hamano wrote: > Johannes Schindelin writes: > >> Also, the more important reply was Peff's reply that suggested that the >> proposed fix was incomplete, as it misses --unpack-unreachable: >>

Re: How to use git show's "%<([,trunc|ltrunc|mtrunc])"?

2017-02-03 Thread Duy Nguyen
On Fri, Feb 3, 2017 at 12:51 AM, Hilco Wijbenga wrote: > Hi all, > > I'm trying to get the committer date printed in a custom fashion. > Using "%cI" gets me close: > > $ git show --format="%cI | %an" master | head -n 1 > 2017-01-31T17:02:13-08:00 | Hilco Wijbenga > > I

Re: [PATCH 00/11] nd/worktree-move update

2017-02-02 Thread Duy Nguyen
On Thu, Feb 2, 2017 at 5:37 PM, Johannes Schindelin <johannes.schinde...@gmx.de> wrote: > Hi Duy, > > On Thu, 2 Feb 2017, Duy Nguyen wrote: > >> On Thu, Feb 2, 2017 at 4:43 PM, Johannes Schindelin >> <johannes.schinde...@gmx.de> wrote: >> &

Re: [PATCH 00/11] nd/worktree-move update

2017-02-02 Thread Duy Nguyen
On Thu, Feb 2, 2017 at 4:43 PM, Johannes Schindelin <johannes.schinde...@gmx.de> wrote: > Hi Duy, > > On Thu, 2 Feb 2017, Duy Nguyen wrote: > >> On Thu, Feb 2, 2017 at 4:16 PM, Johannes Schindelin >> <johannes.schinde...@gmx.de> wrote: >> > Hi Duy, &

Re: init --separate-git-dir does not set core.worktree

2017-02-02 Thread Duy Nguyen
On Thu, Feb 2, 2017 at 10:55 AM, Kyle Meyer wrote: > Hello, > > As of 6311cfaf9 (init: do not set unnecessary core.worktree, > 2016-09-25), "git init --separate-git-dir" no longer sets core.worktree > (test below). Based on the commit message and the corresponding thread > [1],

Re: [PATCH 00/11] nd/worktree-move update

2017-02-02 Thread Duy Nguyen
On Thu, Feb 2, 2017 at 4:16 PM, Johannes Schindelin wrote: > Hi Duy, > > On Thu, 2 Feb 2017, Nguyễn Thái Ngọc Duy wrote: > >> This squashes two changes from Johannes and Ramsay: [...] > > Sorry, I lost track of the worktree discussions... Could you remind me > which

Re: git-daemon shallow checkout fail

2017-02-02 Thread Duy Nguyen
On Tue, Jan 31, 2017 at 12:27 AM, Jeff King wrote: > On Sat, Jan 28, 2017 at 05:29:32PM -0700, Bob Proulx wrote: > >> However the problem driving me crazy is that this only fails this way >> on one machine. Unfortunately failing on the machine I need to use. >> If I try this same

Re: [PATCH] color_parse_mem: allow empty color spec

2017-02-02 Thread Duy Nguyen
On Wed, Feb 01, 2017 at 01:21:29AM +0100, Jeff King wrote: > On Tue, Jan 31, 2017 at 02:45:40PM -0800, Junio C Hamano wrote: > > > * nd/log-graph-configurable-colors (2017-01-23) 3 commits > > (merged to 'next' on 2017-01-23 at c369982ad8) > > + log --graph: customize the graph lines with

Re: [PATCH 4/5] revision.c: refactor ref selection handler after --exclude

2017-01-26 Thread Duy Nguyen
On Thu, Jan 26, 2017 at 3:57 AM, Jeff King wrote: > I don't think it means either. It means to include remotes in the > selected revisions, but excluding the entries mentioned by --exclude. > > IOW: > > --exclude=foo --remotes > include all remotes except refs/remotes/foo

Re: [PATCH 2/5] revision.c: group ref selection options together

2017-01-26 Thread Duy Nguyen
On Thu, Jan 26, 2017 at 3:50 AM, Jeff King wrote: > On Wed, Jan 25, 2017 at 07:50:51PM +0700, Nguyễn Thái Ngọc Duy wrote: > >> These options have on thing in common: when specified right after >> --exclude, they will de-select refs instead of selecting them by >> default. >> >>

Re: [PATCH 2/5] revision.c: group ref selection options together

2017-01-26 Thread Duy Nguyen
On Thu, Jan 26, 2017 at 4:11 AM, Junio C Hamano wrote: > * I am expecting that the new one yet to be introduced will not >share the huge "switch (selector)" part, but does its own things >in a separate function with a similar structure. The only thing >common

Re: [RFC/PATCH] Disallow commands from within unpopulated submodules.

2017-01-21 Thread Duy Nguyen
On Sat, Jan 21, 2017 at 2:17 AM, Jeff King wrote: > On Thu, Jan 19, 2017 at 11:30:23AM -0800, Stefan Beller wrote: > >> Now let's ask the same question for "git -C sub status ." (which is a >> command that is only reading and not writing to the repository) >> >> 1) If the submodule

<    7   8   9   10   11   12   13   14   15   16   >