Re: [PATCH v2 05/14] sha1_file: convert hash_sha1_file to object_id

2018-01-22 Thread Duy Nguyen
On Mon, Jan 22, 2018 at 7:44 PM, Patryk Obara wrote: > On 22 January 2018 at 12:49, Duy Nguyen wrote: >> On Mon, Jan 22, 2018 at 12:04:28PM +0100, Patryk Obara wrote: >>> @@ -969,7 +969,7 @@ static int ident_to_worktree(const char *path, const >>

Re: [PATCH v2 07/14] match-trees: convert splice_tree to object_id

2018-01-22 Thread Duy Nguyen
On Mon, Jan 22, 2018 at 02:12:56PM +0100, Patryk Obara wrote: > >> @@ -197,26 +195,26 @@ static int splice_tree(const unsigned char *hash1, > >> if (strlen(name) == toplen && > >> !memcmp(name, prefix, toplen)) { > >> if (!S_ISDIR(mode)) > >> -

Re: [PATCH] format-patch: set diffstat width to 70 instead of default 80

2018-01-22 Thread Duy Nguyen
On Tue, Jan 23, 2018 at 6:52 AM, Jeff King wrote: > On Mon, Jan 22, 2018 at 07:31:54PM +0700, Nguyễn Thái Ngọc Duy wrote: > >> Patches or cover letters generated by format-patch are meant to be >> exchanged as emails, most of the time. And since it's generally agreed >> that text in mails should b

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

2018-01-22 Thread Duy Nguyen
On Tue, Jan 23, 2018 at 6:09 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh >> index af9b847761..d2a8e0312a 100755 >> --- a/t/t1700-split-index.sh >> +++ b/t/t1700-split-index.sh >> @@ -401,4 +401,23 @@ done <<\EOF >> 0

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

2018-01-23 Thread Duy Nguyen
On Mon, Jan 22, 2018 at 07:03:24PM +0100, SZEDER Gábor wrote: > On Wed, Jan 17, 2018 at 10:34 AM, Duy Nguyen wrote: > > Actually I forgot another option. What if we automate updating the > > script at "compile" time instead of calling git at run time? E.g. with &g

Re: [PATCH 5/5] travis-ci: don't fail if user already exists on 32 bit Linux build job

2018-01-23 Thread Duy Nguyen
On Tue, Jan 23, 2018 at 11:46 PM, Jeff King wrote: >> The build job on Travis CI always starts with a fresh Docker >> container, so this change doesn't make a difference there. > > I wonder if that is fixable. Installing dependencies into the container > takes quite a lot of time, and is just wast

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

2018-01-24 Thread Duy Nguyen
On Tue, Jan 23, 2018 at 1:27 AM, SZEDER Gábor wrote: > > On Thu, Jan 18, 2018 at 1:47 PM, Duy Nguyen wrote: >> 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 f

Re: [PATCH v3 00/14] Some fixes and bunch of object_id conversions

2018-01-25 Thread Duy Nguyen
On Thu, Jan 25, 2018 at 4:41 AM, Junio C Hamano wrote: > Patryk Obara writes: > >> Patryk Obara (14): >> http-push: improve error log >> clang-format: adjust penalty for return type line break >> sha1_file: convert pretend_sha1_file to object_id >> dir: convert struct sha1_stat to use obj

Re: [PATCH] setup: recognise extensions.objectFormat

2018-01-25 Thread Duy Nguyen
On Wed, Jan 24, 2018 at 8:09 PM, Patryk Obara wrote: > This extension selects which hashing algorithm from vtable should be > used for reading and writing objects in the object store. At the moment > supports only single value (sha-1). > > In case value of objectFormat is an unknown hashing algor

Bug, git rebase -i does not abort correctly

2018-01-25 Thread Duy Nguyen
rebase scripts are too much for me, so I'll play the user reporting bugs this time :) Instead of doing $ git rebase -i --onto origin/master @~3 I sometimes accidentally type $ git rebase -i origin/master @~3 ("rebase -i" is actually an alias, which is why I never forget to type -i) Us

Re: [PATCH] merge: support --strategy '?' for git-completion.bash

2018-01-25 Thread Duy Nguyen
On Thu, Jan 25, 2018 at 10:49:45AM -0800, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > > > Bash completion support gets the list of available strategies with a > > grep and sed trick which does not work on non-C locale since the anchor > > string is translated and it does not cover cus

Re: Bug, git rebase -i does not abort correctly

2018-01-26 Thread Duy Nguyen
On Fri, Jan 26, 2018 at 2:50 PM, Kaartic Sivaraam wrote: > This might seem to be a bug as the comment in "git-rebase-todo" says, > > However, if you remove everything, the rebase will be aborted. > > But "man git rebase" clearly says, > > If is specified, git rebase will perform an automa

Re: [PATCH v2 12/27] serve: introduce git-serve

2018-01-26 Thread Duy Nguyen
On Fri, Jan 26, 2018 at 6:58 AM, Brandon Williams wrote: > + Detailed Design > += > + > +A client can request to speak protocol v2 by sending `version=2` in the > +side-channel `GIT_PROTOCOL` in the initial request to the server. > + > +In protocol v2 communication is command orien

Re: [PATCH 2/2] rebase: add --show-patch

2018-01-26 Thread Duy Nguyen
On Fri, Jan 26, 2018 at 6:12 PM, Phillip Wood wrote: >> diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh >> index 06a4723d4d..5c513a9736 100644 >> --- a/git-rebase--merge.sh >> +++ b/git-rebase--merge.sh >> @@ -137,6 +137,10 @@ skip) >> finish_rb_merge >> return >> ;; >>

Re: [PATCH 01/14] graph: add packed graph design document

2018-01-26 Thread Duy Nguyen
On Thu, Jan 25, 2018 at 9:02 PM, Derrick Stolee wrote: > +Git walks the commit graph for many reasons, including: > + > +1. Listing and filtering commit history. > +2. Computing merge bases. > + > +These operations can become slow as the commit count grows above 100K. > +The merge base calculation

Re: [PATCH 03/14] packed-graph: create git-graph builtin

2018-01-26 Thread Duy Nguyen
On Fri, Jan 26, 2018 at 8:14 PM, Derrick Stolee wrote: > On 1/25/2018 6:01 PM, Junio C Hamano wrote: >> >> Derrick Stolee writes: >> >>> Teach Git the 'graph' builtin that will be used for writing and >>> reading packed graph files. The current implementation is mostly >>> empty, except for a che

Re: Some rough edges of core.fsmonitor

2018-01-26 Thread Duy Nguyen
On Sat, Jan 27, 2018 at 7:28 AM, Ævar Arnfjörð Bjarmason wrote: > 3) A lot of time spend reading the index (or something..) I'm resending a patch from my old index-helper series. It should measure all big time consuming blocks in git. Maybe we should get it merged... > While the hook itself take

Re: [PATCH 2/2] rebase: add --show-patch

2018-01-26 Thread Duy Nguyen
On Sat, Jan 27, 2018 at 2:11 AM, Eric Sunshine wrote: > On Fri, Jan 26, 2018 at 4:55 AM, Nguyễn Thái Ngọc Duy > wrote: >> It is useful to see the full patch while resolving conflicts in a >> rebase. The only way to do it now is >> >> less .git/rebase-*/patch >> >> which could turn out to be

Re: [PATCH 0/2] Add "git rebase --show-patch"

2018-01-26 Thread Duy Nguyen
On Sat, Jan 27, 2018 at 1:47 AM, Tim Landscheidt wrote: > Nguyễn Thái Ngọc Duy wrote: > >> When a conflict happens during a rebase, you often need to look at the >> original patch to see what the changes are. This requires opening your >> favourite pager with some random path inside $GIT_DIR. >

Re: Some rough edges of core.fsmonitor

2018-01-27 Thread Duy Nguyen
On Sat, Jan 27, 2018 at 6:43 PM, Ævar Arnfjörð Bjarmason wrote: > a) no fsmonitor > > $ time GIT_TRACE_PERFORMANCE=1 ~/g/git/git-status > 12:32:44.947651 read-cache.c:1890 performance: 0.053153609 s: read > cache .git/index > 12:32:44.967943 preload-index.c:112 performance:

Re: Some rough edges of core.fsmonitor

2018-01-27 Thread Duy Nguyen
On Sat, Jan 27, 2018 at 07:39:27PM +0700, Duy Nguyen wrote: > On Sat, Jan 27, 2018 at 6:43 PM, Ævar Arnfjörð Bjarmason > wrote: > > a) no fsmonitor > > > > $ time GIT_TRACE_PERFORMANCE=1 ~/g/git/git-status > > 12:32:44.947651 read-cache.c:1890 perform

Re: Creating sparse checkout in a new linked git worktree

2018-01-28 Thread Duy Nguyen
On Sun, Jan 28, 2018 at 2:25 PM, Eric Sunshine wrote: > On Wed, Jan 24, 2018 at 11:11 AM, Jessie Hernandez > wrote: >> I am trying to get a sparse checkout in a linked worktree but cannot get >> it working. I have tried the following >> >> * git worktree add /some/new/path/new-branch --no-checkou

Re: Some rough edges of core.fsmonitor

2018-01-29 Thread Duy Nguyen
On Sat, Jan 27, 2018 at 12:43:41PM +0100, Ævar Arnfjörð Bjarmason wrote: > b) with fsmonitor > > $ time GIT_TRACE_PERFORMANCE=1 ~/g/git/git-status > 12:34:23.833625 read-cache.c:1890 performance: 0.049485685 s: read > cache .git/index This is sort of off topic but may be interestin

Re: Shawn Pearce has died

2018-01-29 Thread Duy Nguyen
On Mon, Jan 29, 2018 at 4:33 PM, Johannes Schindelin wrote: > Hey fellow gitters, > > I found these sad news in my timeline today: > > https://twitter.com/cdibona/status/957822400518696960 > At first I didn't believe the subject line I just read. So sorry to hear this. Thanks Shawn for all the co

Re: [PATCH 00/37] removal of some c++ keywords

2018-01-29 Thread Duy Nguyen
On Tue, Jan 30, 2018 at 5:36 AM, Brandon Williams wrote: > A while back there was some discussion of getting our codebase into a state > where we could use a c++ compiler if we wanted to (for various reason like > leveraging c++ only analysis tools, etc.). Johannes Sixt had a very large I would

Re: [PATCH 0/2] Add "git rebase --show-patch"

2018-01-30 Thread Duy Nguyen
On Mon, Jan 29, 2018 at 10:09 PM, Johannes Schindelin wrote: > Hi Duy, > > On Fri, 26 Jan 2018, Nguyễn Thái Ngọc Duy wrote: > >> When a conflict happens during a rebase, you often need to look at the >> original patch to see what the changes are. This requires opening your >> favourite pager with

Re: Missing ? wildcard character in gitignore documentation

2018-01-30 Thread Duy Nguyen
On Mon, Jan 29, 2018 at 10:47:10AM -0500, Randall S. Becker wrote: > The implication of support for ? is there through the following paragraph > from the gitignore documentation: > > "Otherwise, Git treats the pattern as a shell glob suitable for > consumption by fnmatch(3) with the FNM_P

Re: [PATCH v2 2/2] format-patch: reduce patch diffstat width to 72

2018-01-30 Thread Duy Nguyen
On Sat, Jan 27, 2018 at 11:47 PM, Jeff King wrote: > On Thu, Jan 25, 2018 at 06:59:27PM +0700, Nguyễn Thái Ngọc Duy wrote: > >> diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh >> index 9f563db20a..1e62333b46 100755 >> --- a/t/t4052-stat-output.sh >> +++ b/t/t4052-stat-output.sh >> @@

Re: Missing ? wildcard character in gitignore documentation

2018-01-30 Thread Duy Nguyen
On Tue, Jan 30, 2018 at 6:07 PM, Ævar Arnfjörð Bjarmason wrote: > > On Tue, Jan 30 2018, Duy Nguyen jotted: > >> On Mon, Jan 29, 2018 at 10:47:10AM -0500, Randall S. Becker wrote: >>> The implication of support for ? is there through the following paragraph >>>

Re: [PATCH 00/37] removal of some c++ keywords

2018-01-30 Thread Duy Nguyen
On Wed, Jan 31, 2018 at 6:01 AM, Stefan Beller wrote: > On Tue, Jan 30, 2018 at 2:36 PM, Junio C Hamano wrote: >> Duy Nguyen writes: >> >>> Is it simpler (though hacky) to just do >>> >>> #ifdef __cplusplus >>> #define new not_new >>

Re: [PATCH 00/37] removal of some c++ keywords

2018-01-30 Thread Duy Nguyen
On Wed, Jan 31, 2018 at 7:57 AM, Stefan Beller wrote: >> There's also C99 designator in builtin/clean.c (I thought we avoided >> C99, I can start using this specific feature more now :D) > > That was a test balloon? See 512f41cfac > (clean.c: use designated initializer, 2017-07-14) Aww.. I though

Re: Some rough edges of core.fsmonitor

2018-01-31 Thread Duy Nguyen
On Tue, Jan 30, 2018 at 8:21 AM, Ben Peart wrote: > > > On 1/28/2018 5:28 PM, Ævar Arnfjörð Bjarmason wrote: >> >> On Sun, Jan 28, 2018 at 9:44 PM, Johannes Schindelin >> wrote: >>> >>> Hi, >>> >>> On Sat, 27 Jan 2018, Ævar Arnfjörð Bjarmason wrote: >>> I just got around to testing this sinc

Re: [PATCH v2 01/41] parse-options: support --git-completion-helper

2018-01-31 Thread Duy Nguyen
On Thu, Feb 1, 2018 at 4:04 AM, Eric Sunshine wrote: > On Wed, Jan 31, 2018 at 6:05 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 >> >> __gitcomp "lots of completion options" >> >> whic

Re: [PATCH] gitignore.txt: elaborate shell glob syntax

2018-02-01 Thread Duy Nguyen
On Wed, Jan 31, 2018 at 03:22:46PM -0800, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: Argh.. stray patches strike again. It's not supposed to be in this thread but in https://public-inbox.org/git/%3C20180130101351.GA761@ash%3E/ > > > `.gitignore` file). > > > > - - Otherwise, G

Re: [PATCH v2 3/3] rebase: introduce and use pseudo-ref ORIG_COMMIT

2018-02-01 Thread Duy Nguyen
On Thu, Feb 1, 2018 at 6:18 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> The new command `git rebase --show-current-patch` is useful for seeing >> the commit related to the current rebase state. Some however may find >> the "git show" command behind it too limiting. You may want

Re: [PATCH v2 01/41] parse-options: support --git-completion-helper

2018-02-01 Thread Duy Nguyen
On Thu, Feb 1, 2018 at 4:54 PM, Eric Sunshine wrote: > On Wed, Jan 31, 2018 at 7:05 PM, Duy Nguyen wrote: >> On Thu, Feb 1, 2018 at 4:04 AM, Eric Sunshine >> wrote: >>> On Wed, Jan 31, 2018 at 6:05 AM, Nguyễn Thái Ngọc Duy >>> wrote: >>>> Dangerou

Re: Some rough edges of core.fsmonitor

2018-02-01 Thread Duy Nguyen
On Tue, Jan 30, 2018 at 6:16 AM, Ben Peart wrote: > > > On 1/29/2018 4:40 AM, Duy Nguyen wrote: >> >> On Sat, Jan 27, 2018 at 12:43:41PM +0100, Ævar Arnfjörð Bjarmason wrote: >>> >>> b) with fsmonitor >>> >>> $ time GIT_TRACE_PERFO

Re: [PATCH v2 1/3] am: add --show-current-patch

2018-02-02 Thread Duy Nguyen
On Wed, Jan 31, 2018 at 02:59:32PM -0800, Junio C Hamano wrote: > Eric Sunshine writes: > > > On Wed, Jan 31, 2018 at 4:30 AM, Nguyễn Thái Ngọc Duy > > wrote: > >> Pointing the user to $GIT_DIR/rebase-apply may encourage them to mess > >> around in there, which is not a good thing. With this, t

Re: [PATCH 2/7] worktree.c: add update_worktree_location()

2018-02-02 Thread Duy Nguyen
On Fri, Feb 2, 2018 at 3:23 PM, Eric Sunshine wrote: > On Wed, Jan 24, 2018 at 4:53 AM, Nguyễn Thái Ngọc Duy > wrote: >> diff --git a/worktree.c b/worktree.c >> @@ -326,6 +326,24 @@ int validate_worktree(const struct worktree *wt, struct >> strbuf *errmsg) >> +void update_worktree_location(stru

Re: [PATCH v2 1/3] am: add --show-current-patch

2018-02-02 Thread Duy Nguyen
On Fri, Feb 2, 2018 at 4:46 PM, Eric Sunshine wrote: > On Fri, Feb 2, 2018 at 4:25 AM, Duy Nguyen wrote: >> On Wed, Jan 31, 2018 at 02:59:32PM -0800, Junio C Hamano wrote: >>> Eric Sunshine writes: >>> > On Wed, Jan 31, 2018 at 4:30 AM, Nguyễn Thái Ngọc Duy &

Re: contrib/completion/git-completion.bash: declare -g is not portable

2018-02-04 Thread Duy Nguyen
On Sun, Feb 4, 2018 at 12:20 AM, Torsten Bögershausen wrote: > Hej Duy, > After running t9902-completion.sh on Mac OS I got a failure > in this style: Sorry I was new with this bash thingy. Jeff already answered this (and I will fix it in the re-roll) but just for my own information, what bash ve

Re: [PATCH v2 1/3] worktree: improve message when creating a new worktree

2018-02-04 Thread Duy Nguyen
On Sun, Feb 04, 2018 at 10:13:03PM +, Thomas Gummerer wrote: > diff --git a/builtin/worktree.c b/builtin/worktree.c > index 7cef5b120b..d1549e441d 100644 > --- a/builtin/worktree.c > +++ b/builtin/worktree.c > @@ -303,7 +303,7 @@ static int add_worktree(const char *path, const char > *refname,

Re: [PATCH v2 3/3] worktree: teach "add" to check out existing branches

2018-02-04 Thread Duy Nguyen
On Sun, Feb 04, 2018 at 10:13:05PM +, Thomas Gummerer wrote: > - if (opts->new_branch) > + if (opts->checkout_existing_branch) > + fprintf(stderr, _(", checking out existing branch '%s'"), > + refname); > + else if (opts->new_branch) > f

Re: [PATCH v2 01/41] parse-options: support --git-completion-helper

2018-02-05 Thread Duy Nguyen
On Thu, Feb 01, 2018 at 02:16:46PM -0500, Eric Sunshine wrote: > On Thu, Feb 1, 2018 at 5:21 AM, Duy Nguyen wrote: > > On Thu, Feb 1, 2018 at 4:54 PM, Eric Sunshine > > wrote: > >> I don't see that as convincing argument for two classes of "no > >> c

Re: [PATCH v2 01/41] parse-options: support --git-completion-helper

2018-02-05 Thread Duy Nguyen
On Mon, Feb 5, 2018 at 5:46 PM, Ævar Arnfjörð Bjarmason wrote: > > On Wed, Jan 31 2018, Eric Sunshine jotted: > >> On Wed, Jan 31, 2018 at 6:05 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 usua

Re: [PATCH v3 0/2] diff: add --stat-with-summary (was --compact-summary)

2018-02-05 Thread Duy Nguyen
On Sat, Feb 3, 2018 at 2:59 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> Changes since v2 [1]: >> >> - goes back to my original version (yay!) where the extra info >> is appended after the path name. More is described in 2/2 >> - --compact-summary is now renamed --stat-with-su

Re: [PATCH 3/7] worktree move: new command

2018-02-05 Thread Duy Nguyen
On Fri, Feb 2, 2018 at 6:23 PM, Eric Sunshine wrote: > On Fri, Feb 2, 2018 at 4:15 AM, Eric Sunshine wrote: >> On Wed, Jan 24, 2018 at 4:53 AM, Nguyễn Thái Ngọc Duy >> wrote: >>> +static int move_worktree(int ac, const char **av, const char *prefix) >>> +{ >>> + [...] >>> + worktree

Re: Bug? Error during commit

2018-02-05 Thread Duy Nguyen
On Mon, Feb 5, 2018 at 8:48 PM, Andreas Kalz wrote: > Hello, > > I am using git frequently and usually it is running great. > > I read to write to this eMail address regarding problems and possible bugs. > I am using git version 2.16.1.windows.2 / 64 Bit and during commit the > following error me

Re: [RFC/PATCH] worktree: replace "checkout --to" with "worktree new"

2015-06-30 Thread Duy Nguyen
On Tue, Jun 30, 2015 at 11:56 AM, Eric Sunshine wrote: > The command "git checkout --to " is something of an anachronism, > encompassing functionality somewhere between "checkout" and "clone". > The introduction of the git-worktree command, however, provides a proper > and intuitive place to house

Re: [PATCH] Avoid the need of "--" when wildcard pathspec is used

2015-06-30 Thread Duy Nguyen
On Wed, Jul 1, 2015 at 1:10 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> When "--" is lacking from the command line and a command can take both >> revs and paths, the idea is if an argument can be seen as both an >> extended SHA-1 and a path, then "--" is required or git refuses

Re: [PATCH] worktree: new place for "git prune --worktrees"

2015-07-01 Thread Duy Nguyen
On Mon, Jun 29, 2015 at 11:13 PM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> Commit 23af91d (prune: strategies for linked checkouts - 2014-11-30) >> adds "--worktrees" to "git prune" without realizing that "git prune" is >> for object database only. This patch moves the same funct

Re: [RFC/PATCH] worktree: replace "checkout --to" with "worktree new"

2015-07-01 Thread Duy Nguyen
On Tue, Jun 30, 2015 at 11:33 PM, Junio C Hamano wrote: > Duy Nguyen writes: > >> I think this is like "git checkout -b" vs "git branch". We pack so >> many things in 'checkout' that it's a source of both convenience and >> confusio

Re: [RFC/PATCH] worktree: replace "checkout --to" with "worktree new"

2015-07-01 Thread Duy Nguyen
On Thu, Jul 2, 2015 at 12:13 AM, Eric Sunshine wrote: >>I noticed GIT_CHECKOUT_NEW_WORKTREE environment variabl that does >>not seem to be documented. Is this something we still need? >>The log message of 529fef20 (checkout: support checking out into >>a new working directory, 201

Re: [RFC/PATCH] worktree: replace "checkout --to" with "worktree new"

2015-07-02 Thread Duy Nguyen
On Thu, Jul 2, 2015 at 9:52 AM, Eric Sunshine wrote: > On Wed, Jul 1, 2015 at 9:07 PM, Duy Nguyen wrote: >> On Thu, Jul 2, 2015 at 12:13 AM, Eric Sunshine >> wrote: >>>>I noticed GIT_CHECKOUT_NEW_WORKTREE environment variabl that does >>>>not se

Re: [RFC/PATCH] worktree: replace "checkout --to" with "worktree new"

2015-07-02 Thread Duy Nguyen
On Thu, Jul 2, 2015 at 7:41 PM, Duy Nguyen wrote: >> merge_working_tree: >> tree = parse_tree_indirect(old->commit && >> !opts->new_worktree_mode ? >> old->commit->object.sha1 : >> EMPTY_TREE_SHA1_BIN); >

Re: [RFC/PATCH] worktree: replace "checkout --to" with "worktree new"

2015-07-02 Thread Duy Nguyen
On Fri, Jul 3, 2015 at 12:06 AM, Eric Sunshine wrote: >> Unless we want to borrow fancy checkout options for "git worktree >> add", we probably should just export checkout() function from clone.c >> and use it instead of "git checkout". Much more lightweight and >> simpler (it's one-way merge). Th

Re: [PATCH 2/2] index-pack: kill union delta_base to save memory

2015-07-03 Thread Duy Nguyen
On Fri, Jul 3, 2015 at 11:51 PM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> Once we know the number of objects in the input pack, we allocate an >> array of nr_objects of struct delta_entry. On x86-64, this struct is >> 32 bytes long. The union delta_base, which is part of struct

Re: [PATCH v2 04/23] Documentation/git-worktree: add BUGS section

2015-07-03 Thread Duy Nguyen
On Sat, Jul 4, 2015 at 7:17 AM, Eric Sunshine wrote: > +git-worktree could provide more automation for tasks currently > +performed manually or via other commands, such as: > + > +- `add` to create a new linked worktree > +- `remove` to remove a linked worktree and its administrative files (and >

Re: [PATCH v2 08/23] checkout: fix bug with --to and relative HEAD

2015-07-03 Thread Duy Nguyen
On Sat, Jul 4, 2015 at 7:17 AM, Eric Sunshine wrote: > Given "git checkout --to HEAD~1", the new worktree's HEAD should > begin life at the current branch's HEAD~1, however, it actually ends up > at HEAD~2. The happens because: > > 1. git-checkout resolves HEAD~1 > > 2. to satisfy is_git_

Re: [PATCH v2 13/23] worktree: introduce "add" command

2015-07-03 Thread Duy Nguyen
On Sat, Jul 4, 2015 at 7:17 AM, Eric Sunshine wrote: > COMMANDS > > +add :: > + > +Check out `` into a separate working directory, ``, creating > +`` if necessary. The new working directory is linked to the current > +repository, sharing everything except working directory specific fil

Re: [PATCH v2 18/23] checkout: retire --to option

2015-07-03 Thread Duy Nguyen
On Sat, Jul 4, 2015 at 7:17 AM, Eric Sunshine wrote: > Now that "git worktree add" has achieved user-facing feature-parity with > "git checkout --to", retire the latter. > > Move the actual linked worktree creation functionality, > prepare_linked_checkout() and its helpers, verbatim from checkout.

Re: [PATCH v2 16/23] worktree: add -b/-B options

2015-07-03 Thread Duy Nguyen
On Sat, Jul 4, 2015 at 7:17 AM, Eric Sunshine wrote: > One of git-worktree's roles is to populate the new worktree, much like > git-checkout, and thus, for convenience, ought to support several of the > same shortcuts. Toward this goal, add -b/-B options to create a new > branch and check it out i

Re: [PATCH v2 13/23] worktree: introduce "add" command

2015-07-06 Thread Duy Nguyen
On Sat, Jul 4, 2015 at 3:54 PM, Eric Sunshine wrote: > On Fri, Jul 3, 2015 at 10:53 PM, Duy Nguyen wrote: >> On Sat, Jul 4, 2015 at 7:17 AM, Eric Sunshine >> wrote: >>> COMMANDS >>> >>> +add :: >>> + >>> +Check out `

Re: Git grep does not support multi-byte characters (like UTF-8)

2015-07-06 Thread Duy Nguyen
On Mon, Jul 6, 2015 at 6:28 PM, Plamen Totev wrote: > Hello, > > It looks like the git grep command does not support multi-byte character sets > like UTF-8. As a result some of the grep functionality is not working. For > example if you search for non Latin words the ignore case flag does not ha

Re: [PATCH] grep: use regcomp() for icase search with non-ascii patterns

2015-07-06 Thread Duy Nguyen
On Tue, Jul 7, 2015 at 3:10 AM, René Scharfe wrote: > Am 06.07.2015 um 14:42 schrieb Nguyễn Thái Ngọc Duy: >> >> Noticed-by: Plamen Totev >> Signed-off-by: Nguyễn Thái Ngọc Duy >> --- >> grep.c | 14 +++--- >> 1 file changed, 11 insertions(+), 3 deletions(-) >> >> diff --git a/grep.c

Re: [PATCH] index-pack: fix allocation of sorted_by_pos array

2015-07-06 Thread Duy Nguyen
On Sun, Jul 5, 2015 at 5:30 AM, Junio C Hamano wrote: > When c6458e60 (index-pack: kill union delta_base to save memory, > 2015-04-18) attempted to reduce the memory footprint of index-pack, > one of the key thing it did was to keep track of ref-deltas and > ofs-deltas separately. > > In fix_unres

Re: Git grep does not support multi-byte characters (like UTF-8)

2015-07-07 Thread Duy Nguyen
efactor would be needed. "git grep regcomp" reveals some many places. Many some of them would benefit from kws if we provide this new function you mentioned. > Regards, > Plamen Totev > > > >> Оригинално писмо >>От: Duy Nguyen pclo...@gmail.com >>Относно: Re: Gi

Re: Git grep does not support multi-byte characters (like UTF-8)

2015-07-07 Thread Duy Nguyen
On Wed, Jul 8, 2015 at 1:08 AM, Plamen Totev wrote: > Junio C Hamano writes: > >> Plamen Totev writes: >> >> > pickaxe search also uses kwsearch so the case insensitive search with >> > it does not work (e.g. git log -i -S). Maybe this is a less of a >> > problem here as one is expected to searc

Re: [PATCH v2 5/9] grep/pcre: prepare locale-dependent tables for icase matching

2015-07-08 Thread Duy Nguyen
On Wed, Jul 8, 2015 at 5:38 PM, Nguyễn Thái Ngọc Duy wrote: > diff --git a/grep.c b/grep.c > index 8fce54f..c79aa70 100644 > --- a/grep.c > +++ b/grep.c > @@ -324,11 +324,13 @@ static void compile_pcre_regexp(struct grep_pat *p, > const struct grep_opt *opt) > int erroffset; > int

Re: [PATCH v2 0/9] icase match on non-ascii

2015-07-08 Thread Duy Nguyen
On Wed, Jul 8, 2015 at 6:32 PM, Torsten Bögershausen wrote: > On 2015-07-08 12.38, Nguyễn Thái Ngọc Duy wrote: >> Side note, I almost added the third has_non_ascii() function. Maybe we >> should consider merging the two existing has_non_ascii() functions >> back, or rename one to something else. >

Re: Since gc.autodetach=1 you can end up with auto-gc on every command with no user notification

2015-07-08 Thread Duy Nguyen
On Wed, Jul 8, 2015 at 7:28 PM, Ævar Arnfjörð Bjarmason wrote: > Someone at work came to me with the problem that they were getting the > "Auto packing the repository in background for optimum performance" > notice on every Git command that they ran. > > This problem is a combination of two things

Re: [PATCH 2/2] pack-objects: rename the field "type" to "real_type"

2015-07-08 Thread Duy Nguyen
On Wed, Jul 8, 2015 at 8:47 PM, Jeff King wrote: > On Wed, Jul 08, 2015 at 06:56:31PM +0700, Nguyễn Thái Ngọc Duy wrote: > >> This is to avoid the too generic name "type" and harmonize with the >> naming in index-pack. There's a subtle difference though: real_type in >> index-pack is what the uppe

Re: [PATCH v2 0/9] icase match on non-ascii

2015-07-08 Thread Duy Nguyen
On Wed, Jul 8, 2015 at 10:36 PM, Junio C Hamano wrote: >> Patch 5 is "funny". The patch itself is in iso-8859-1, but my name in >> the commit message is in utf-8. > > As an e-mail message is a single file, by definition that is not merely > "funny" but just "broken", no matter what encoding your M

Re: [PATCH 10/16] worktree: make branch creation distinct from worktree population

2015-07-11 Thread Duy Nguyen
On Sat, Jul 11, 2015 at 7:05 AM, Eric Sunshine wrote: > The plan is eventually to populate the new worktree via "git reset > --hard" rather than "git checkout". Thus, rather than piggybacking on > git-checkout's -b/-B ability to create a new branch at checkout time, > git-worktree will need to do

Re: [PATCH v2 01/10] ref-filter: add %(refname:shortalign=X) option

2015-07-11 Thread Duy Nguyen
On Sat, Jul 11, 2015 at 7:05 PM, Karthik Nayak wrote: > On Fri, Jul 10, 2015 at 9:50 PM, Junio C Hamano wrote: >> >> This may be enough to support the various existing formats that are >> offered by "git branch" and/or "git tag", but I do not think if this >> is the right approach in the longer t

Re: [PATCH 10/16] worktree: make branch creation distinct from worktree population

2015-07-11 Thread Duy Nguyen
On Sun, Jul 12, 2015 at 9:36 AM, Eric Sunshine wrote: > On Sat, Jul 11, 2015 at 9:20 PM, Duy Nguyen wrote: >> On Sat, Jul 11, 2015 at 7:05 AM, Eric Sunshine >> wrote: >>> The plan is eventually to populate the new worktree via "git reset >>> --hard&quo

Re: [PATCH v2 01/10] ref-filter: add %(refname:shortalign=X) option

2015-07-12 Thread Duy Nguyen
On Sun, Jul 12, 2015 at 8:47 AM, Duy Nguyen wrote: > Another thing, the atom value is also used for sorting. When used for > sorting, I think these padding spaces should not be generated or it > may confuse the sort algorithm. Left alignment may be ok, right or > center alignmen

Re: [RFC/PATCH 4/9] ref-filter: add support to sort by version

2015-07-12 Thread Duy Nguyen
On Thu, Jun 25, 2015 at 6:43 PM, Karthik Nayak wrote: > Add support to sort by version using the "v:refname" and > "version:refname" option. This is achieved by using the > 'version_cmp()' function as the comparing function for qsort. If these v:refname and version:refname are from git-tag, you m

Re: [PATCH v2 08/10] tag.c: use 'ref-filter' APIs

2015-07-12 Thread Duy Nguyen
On Thu, Jul 9, 2015 at 5:58 PM, Karthik Nayak wrote: > -static int show_reference(const char *refname, const struct object_id *oid, > - int flag, void *cb_data) > -{ ... > - > - if (match_pattern(filter->name_patterns, refname)) { > - printf("%-15s

Re: [PATCH 10/16] worktree: make branch creation distinct from worktree population

2015-07-12 Thread Duy Nguyen
(resend, +everybody) On Sun, Jul 12, 2015 at 10:27 AM, Eric Sunshine wrote: >>> So, if I understand your concern correctly, then you are worried that, >>> following the git-branch invocation, ref_exists() could return the >>> wrong answer with a pluggable ref-backend since it might be answering >

Re: [PATCH v2 08/10] tag.c: use 'ref-filter' APIs

2015-07-13 Thread Duy Nguyen
On Mon, Jul 13, 2015 at 2:36 AM, Karthik Nayak wrote: > What I was thinking of was getting rid of the whole "align" feature where > you provide a value to which it would align. > > Something like: --format="%(item:modifieralign)" which would use something > on the lines of what the max-width calc

Re: [PATCH v2 01/10] ref-filter: add %(refname:shortalign=X) option

2015-07-13 Thread Duy Nguyen
On Mon, Jul 13, 2015 at 2:56 AM, Karthik Nayak wrote: > On Sun, Jul 12, 2015 at 7:17 AM, Duy Nguyen wrote: >> >> I guess if you can have multiple arguments after ':' in an atom, then >> you have wiggle room for future. But it looks like you only accept one >>

Re: [PATCH 00/16] worktree: use "git reset --hard" to populate worktree

2015-07-14 Thread Duy Nguyen
On Tue, Jul 14, 2015 at 4:53 PM, Michael J Gruber wrote: > Related to that, I'm interested in "worktree list", and I'm wondering > how many more worktree commands we foresee, and therefore how much > refactoring should be done: Currently, the parsing of the contents of > .../worktrees/ into worktr

Re: [PATCH v3 0/9] icase match on non-ascii

2015-07-15 Thread Duy Nguyen
On Tue, Jul 14, 2015 at 11:42 PM, Torsten Bögershausen wrote: > (I haven't been able to do more debugging yet, > but this doesn't fully work on my Mac OS X box:) > > Initialized empty Git repository in > /Users/tb/NoBackup/projects/git/tb.150714_Duy_grep_utf8/t/trash > directory.t7812-grep-icase-n

Re: [PATCH 00/16] worktree: use "git reset --hard" to populate worktree

2015-07-15 Thread Duy Nguyen
On Wed, Jul 15, 2015 at 1:48 PM, Eric Sunshine wrote: >> - check_linked_checkout() when trying to decide what branch is >>checked out assumes HEAD is always a regular file, but I do not >>think we have dropped the support of SYMLINK_HEAD yet. It needs >>to check st_mode and readlink(

Re: workdirs: cannot clone a local workdir directory

2015-07-15 Thread Duy Nguyen
On Wed, Jul 15, 2015 at 11:40:18AM +0200, Bjørnar Snoksrud wrote: > I reported this before, but now I have a nice topic to hang it on - > > I have re-reproduced the bug using a build from master as of today, > using the new worktree commands. Something like the following patch should work if you

Re: A few "linked checkout" niggles

2015-07-15 Thread Duy Nguyen
On Thu, Jul 16, 2015 at 6:13 AM, Junio C Hamano wrote: > I've tried to set up a non-bare clone of git.git at ~/w/src and > attached one of its branches to a separate work tree at ~/w/rerere > > ~/w/src$ git worktree add ../rerere jc/rerere > > Then I tried the "multiple checkout not allowed". > >

Re: A few "linked checkout" niggles

2015-07-16 Thread Duy Nguyen
On Fri, Jul 17, 2015 at 3:39 AM, Junio C Hamano wrote: > Also in a linked checkout of git.git itself, t5601.21 seems to fail > with: > > fatal: Not a git repository: /home/gitster/w/src/.git/worktrees/rerere > not ok 21 - clone respects global branch.autosetuprebase > # > # ( > #

Re: [PATCH v2 06/20] checkout: check_linked_checkout: improve "already checked out" aesthetic

2015-07-16 Thread Duy Nguyen
On Fri, Jul 17, 2015 at 7:32 AM, Eric Sunshine wrote: >> In the new world order with GIT_DIR and GIT_COMMON_DIR, does >> "$GIT_DIR" always have to be the same as "$GIT_WORK_TREE/.git"? Do >> we need some sanity check if that is the case? Perhaps: if you have >> $GIT_DIR set to $somewhere/.git/wo

Re: A few "linked checkout" niggles

2015-07-17 Thread Duy Nguyen
On Fri, Jul 17, 2015 at 7:27 PM, Michael J Gruber wrote: > Two more observations: > > $ git worktree add /tmp/gitwt > Enter /tmp/gitwt (identifier gitwt) > Switched to a new branch 'gitwt' > > Now I'm in /tmp/gitwt at branch gitwt. Right? No. I'm in the original wd > at the original branch. > > So

Re: [PATCH v2] Documentation/git: fix stale "MULTIPLE CHECKOUT MODE" reference

2015-07-18 Thread Duy Nguyen
On Sat, Jul 18, 2015 at 12:03 AM, Junio C Hamano wrote: > The other one is more heavy. Do we even want to have and expose > GIT_COMMON_DIR environment variable? > > The primary reason why we added GIT_DIR, GIT_OBJECT_DIRECTORY > etc. in the early days of Git was because we didn't exactly know > w

Re: [PATCH v2] unpack-trees: don't update files with CE_WT_REMOVE set

2015-07-18 Thread Duy Nguyen
On Fri, Jul 17, 2015 at 05:19:27PM -0400, David Turner wrote: > Don't update files in the worktree from cache entries which are > flagged with CE_WT_REMOVE. > > When a user does a sparse checkout, git removes files that are marked > with CE_WT_REMOVE (because they are out-of-scope for the sparse >

Re: [PATCH v4 01/10] ref-filter: add option to align atoms to the left

2015-07-26 Thread Duy Nguyen
On Sun, Jul 26, 2015 at 11:08 AM, Eric Sunshine wrote: > You can generate an interdiff with "git diff branchname-v4 > branchname-v5", for instance. Off topic. But what stops me from doing this often is it creates a big mess in "git tag -l". Do we have an option to hide away some "insignificant:"

Re: [PATCH v4 01/10] ref-filter: add option to align atoms to the left

2015-07-27 Thread Duy Nguyen
On Mon, Jul 27, 2015 at 2:39 PM, Jacob Keller wrote: > On Sun, Jul 26, 2015 at 5:39 PM, Duy Nguyen wrote: >> On Sun, Jul 26, 2015 at 11:08 AM, Eric Sunshine >> wrote: >>> You can generate an interdiff with "git diff branchname-v4 >>> branchname-v5&quo

Re: [PATCH] clone: fix repo name when cloning a server's root

2015-07-27 Thread Duy Nguyen
On Mon, Jul 27, 2015 at 6:48 PM, Patrick Steinhardt wrote: > When cloning a repository from a server's root, that is the URL's > path component is a '/' only, we fail to generate a sensible > repository name when the URL contains authentication data. This > is especially bad when cloning URLs like

Re: Log messages beginning # and git rebase -i

2015-07-27 Thread Duy Nguyen
On Tue, Jul 28, 2015 at 6:25 AM, Eric Sunshine wrote: > On Mon, Jul 27, 2015 at 7:38 AM, Ed Avis wrote: >> git commit will happily let you specify log messages beginning with #. >> But then on git rebase -i, when squashing some commits, the editing for the >> combined log message treats lines beg

Re: [PATCH v4 01/10] ref-filter: add option to align atoms to the left

2015-07-28 Thread Duy Nguyen
On Mon, Jul 27, 2015 at 5:18 PM, Duy Nguyen wrote: > On Mon, Jul 27, 2015 at 2:39 PM, Jacob Keller wrote: >> On Sun, Jul 26, 2015 at 5:39 PM, Duy Nguyen wrote: >>> On Sun, Jul 26, 2015 at 11:08 AM, Eric Sunshine >>> wrote: >>>> You can generate an

Fwd: Bug#793884: git: allows nonsensical command 'git checkout -b HEAD'

2015-07-28 Thread Duy Nguyen
This seems like a good thing to fix (i.e. make sure XX is not ambiguous before creating it with "git checkout -b XX") -- Forwarded message -- From: Andreas Beckmann Date: Tue, Jul 28, 2015 at 9:18 PM Subject: Bug#793884: git: allows nonsensical command 'git checkout -b HEAD' To:

Re: Log messages beginning # and git rebase -i

2015-07-29 Thread Duy Nguyen
On Wed, Jul 29, 2015 at 12:48 AM, Matthieu Moy wrote: >> If the user wants whatever she types in the resulting commit >> literally, there is the "--cleanup=" option, no? > > $ GIT_EDITOR=touch git commit --cleanup=verbatim > [detached HEAD 1b136a7] # Please enter the commit message for your change

Re: Log messages beginning # and git rebase -i

2015-07-29 Thread Duy Nguyen
On Wed, Jul 29, 2015 at 7:17 PM, Matthieu Moy wrote: > Duy Nguyen writes: > >> On Wed, Jul 29, 2015 at 12:48 AM, Matthieu Moy >> wrote: >>>> If the user wants whatever she types in the resulting commit >>>> literally, there is the "--cleanup=&quo

<    3   4   5   6   7   8   9   10   11   12   >