[PATCH v3 2/2] gitk: synchronize config write

2014-11-08 Thread Max Kirillov
If several gitk instances are closed simultaneously, safestuff procedure can run at the same time, resulting in a conflict which may cause losing of some of the instance's changes, failing the saving operation or even corrupting the configuration file. This can happen, for example, at user session

[PATCH v3 1/2] gitk: write only changed configuration variables

2014-11-08 Thread Max Kirillov
When gitk contains some changed parameter, and there is existing instance of gitk where the parameter is still old, it is reverted to that old value when the instance exits. Instead, store a parameter in config only it is has been modified in the exiting instance. Otherwise, preserve the value whi

[PATCH v3 0/2] gitk: save only changed configuration on exit

2014-11-08 Thread Max Kirillov
Hi. Used explivit changed flag for views instead of trace. Minor style fixes. As I said, could not use namespace for older config read because they leak to globals. Max Kirillov (2): gitk: write only changed configuration variables gitk: synchronize config write gitk | 115

Re: [PATCH] replace: fix replacing object with itself

2014-11-08 Thread Jeff King
On Sun, Nov 09, 2014 at 01:05:31AM +0100, Manzur Mukhitdinov wrote: > When object is replaced with itself git shows unhelpful messages like(git > log): > "fatal: replace depth too high for object " > > Prevents user from replacing object with itself(with test for checking > this case). I th

Re: Test failure

2014-11-08 Thread Michael Blume
$ ./t1410-reflog.sh -v -i Initialized empty Git repository in /Users/michael.blume/workspace/git/t/trash directory.t1410-reflog/.git/ expecting success: mkdir -p A/B && echo rat >C && echo ox >A/D && echo tiger >A/B/E && git add . && test_tick && git commit -m rabbit && H=`git rev-parse --verify H

Re: [PATCH 1/3] tree.c: update read_tree_recursive callback to pass strbuf as base

2014-11-08 Thread Eric Sunshine
On Sat, Nov 8, 2014 at 6:00 AM, Nguyễn Thái Ngọc Duy wrote: > This allows the callback to use 'base' as a temporary buffer to > quickly assemble full path "without" extra allocation. The caller has > to restore it afterwards of course. > > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > diff --git a/

Re: [PATCH v2 22/22] untracked cache: guard and disable on system changes

2014-11-08 Thread Eric Sunshine
On Sat, Nov 8, 2014 at 4:39 AM, Nguyễn Thái Ngọc Duy wrote: > If the user enables untracked cache, then > > - move worktree to an unsupported filesystem > - or simply upgrade OS > - or move the whole (portable) disk from one machine to another > - or access a shared fs from another machine > >

Re: [PATCH v2 21/22] mingw32: add uname()

2014-11-08 Thread Eric Sunshine
On Sat, Nov 8, 2014 at 4:39 AM, Nguyễn Thái Ngọc Duy wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > diff --git a/compat/mingw.c b/compat/mingw.c > index c5c37e5..b817678 100644 > --- a/compat/mingw.c > +++ b/compat/mingw.c > @@ -2128,3 +2128,14 @@ void mingw_startup() > /* initializ

[PATCH] t1410: fix breakage on case-insensitive filesystems

2014-11-08 Thread Jeff King
On Sat, Nov 08, 2014 at 08:43:54PM -0500, Jeff King wrote: > Unfortunately I don't have an OS X install handy to test on. I lied; it turns out I still had access to an old VM. The problem did turn out to be rather silly. Here's a patch. -- >8 -- Two tests recently added to t1410 create branches

Re: Test failure

2014-11-08 Thread Jeff King
On Sat, Nov 08, 2014 at 11:28:32AM -0800, Michael Blume wrote: > When I build and run tests I get > > [11:17][michael.blume@tcc-michael-4:~/workspace/git/t(master)]$ > ./t1410-reflog.sh What does "./t1410-reflog.sh -v -i" report? > A quick search seems to indicate the test is pretty new? > http

[PATCH] replace: fix replacing object with itself

2014-11-08 Thread Manzur Mukhitdinov
When object is replaced with itself git shows unhelpful messages like(git log): "fatal: replace depth too high for object " Prevents user from replacing object with itself(with test for checking this case). Signed-off-by: Manzur Mukhitdinov --- builtin/replace.c | 3 +++ t/t6050-replace.sh

Test failure

2014-11-08 Thread Michael Blume
I'm on a macbook running a beta of Mac OS Yosemite 10.10.1. I've never been able to get GETTEXT to work so I have NO_GETTEXT=1 in my makefile, but other than that I'm using the master branch of the official github mirror. When I build and run tests I get [11:17][michael.blume@tcc-michael-4:~/wo

Re: [PATCH 1/2] Add a few more values for receive.denyCurrentBranch

2014-11-08 Thread brian m. carlson
On Sat, Nov 08, 2014 at 06:18:55AM -0500, Jeff King wrote: > On Fri, Nov 07, 2014 at 02:58:17PM +0100, Johannes Schindelin wrote: > > > Under certain circumstances, it makes a *lot* of sense to allow pushing > > into the current branch. For example, when two machines with different > > Operating S

--trust-exit-code not working

2014-11-08 Thread Adri Farr
Hello!, Firstly, thank you very much to those that contributed the patch; I truly appreciate it. I haven't been able to make it work in 2.2.0.rc1, though. I'm not sure whether it's my fault, or the patch', but a 'git difftool --trust-exit-code' call with vimdiff as the diff tool and exiting with :

Re: Using git clone

2014-11-08 Thread brian m. carlson
On Tue, Nov 04, 2014 at 11:59:59AM -0500, Dr. George E. Moore wrote: > Is it appropriate to use "git clone" to update the master branch of an > existing repository? The current master branch is for a much earlier > release candidate. You generally want to use git fetch or git pull in that case. g

Re: [PATCH v2 02/22] untracked cache: record .gitignore information and dir hierarchy

2014-11-08 Thread brian m. carlson
On Sat, Nov 08, 2014 at 04:39:35PM +0700, Nguyễn Thái Ngọc Duy wrote: > The requirement for this to work is stat info of a directory MUST > change if an entry is added to or removed from that directory (and > should not change often otherwise). If your OS and filesytem do not Should be "filesystem

Re: [RFC] git checkout $tree -- $path always rewrites files

2014-11-08 Thread Martin von Zweigbergk
First of all, thanks again for spending time on this. On Sat, Nov 8, 2014 at 12:30 AM, Jeff King wrote: > On Fri, Nov 07, 2014 at 11:35:59PM -0800, Junio C Hamano wrote: > > So just to be clear, the behavior we want is that: > > echo foo >some-new-path > git add some-new-path > git checkout

Re: What is the default refspec for fetch?

2014-11-08 Thread Jakub Narębski
W dniu 2014-11-08 11:52, Jeff King pisze: On Fri, Nov 07, 2014 at 04:31:08PM +0100, Christian Halstrick wrote: In a repo where no remote..fetch config parameter is set what should a "git fetch" do? My experiments let me think it's "HEAD:FETCH_HEAD". Right? Basically, yes. We always write FETC

[PATCH v2 2/2] git_connect: when using GIT_SSH_CMD, check for plink in argv[0] only

2014-11-08 Thread Thomas Quinot
git_connect includes circuitry to use specific command line arguments when using PuTTY's plink. This circuitry is enabled based on the presence of the "plink" and "tortoiseplink" substrings in the name of the SSH program to use. When using GIT_SSH_CMD to specify a complete shell command to run for

[PATCH v2 1/2] git_connect: set ssh shell command in GIT_SSH_CMD

2014-11-08 Thread Thomas Quinot
It may be impractical to install a wrapper script for GIT_SSH when additional parameters need to be passed. Provide an alternative way of specifying a shell command to be run, including command line arguments, by means of the GIT_SSH_CMD environment variable, which behaves like GIT_SSH but is passe

Using git clone

2014-11-08 Thread Dr. George E. Moore
Is it appropriate to use "git clone" to update the master branch of an existing repository? The current master branch is for a much earlier release candidate. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH] git_connect: allow passing arguments to ssh in GIT_SSH_ARGS

2014-11-08 Thread Thomas Quinot
Jeff, Thanks for your feedback! * Jeff King, 2014-11-08 : > What do you think of adding an alternate variable that is not ssh > _arguments_, but rather just a full shell command for running ssh? > I'm not sure what it could be called (GIT_SSH_SH is probably too > confusing). Interesting idea, I

Re: [PATCH 1/2] Add a few more values for receive.denyCurrentBranch

2014-11-08 Thread Jeff King
On Fri, Nov 07, 2014 at 02:58:17PM +0100, Johannes Schindelin wrote: > Under certain circumstances, it makes a *lot* of sense to allow pushing > into the current branch. For example, when two machines with different > Operating Systems are required for testing, it makes much more sense to > synchr

Re: [PATCH] git_connect: allow passing arguments to ssh in GIT_SSH_ARGS

2014-11-08 Thread Jeff King
On Sat, Nov 08, 2014 at 11:44:39AM +0100, Thomas Quinot wrote: > It may be impractical to install a wrapper script for ssh > when additional parameters need to be passed. Provide an > alternative way of specifying these by means of the GIT_SSH_ARGS > environment variable. Arguments are whitespace

Re: [PATCH 1/3] tree.c: update read_tree_recursive callback to pass strbuf as base

2014-11-08 Thread Duy Nguyen
On Sat, Nov 8, 2014 at 6:00 PM, Nguyễn Thái Ngọc Duy wrote: > This allows the callback to use 'base' as a temporary buffer to > quickly assemble full path "without" extra allocation. The caller has Errr.. the _callback_ has to. restore... > to restore it afterwards of course. -- Duy -- To unsub

[PATCH 2/3] ls-tree: disable negative pathspec because it's not supported

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/ls-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c index 1ab0381..d226344 100644 --- a/builtin/ls-tree.c +++ b/builtin/ls-tree.c @@ -174,7 +174,8 @@ int cmd_ls_tree(int argc, const c

[PATCH 1/3] tree.c: update read_tree_recursive callback to pass strbuf as base

2014-11-08 Thread Nguyễn Thái Ngọc Duy
This allows the callback to use 'base' as a temporary buffer to quickly assemble full path "without" extra allocation. The caller has to restore it afterwards of course. Signed-off-by: Nguyễn Thái Ngọc Duy --- archive.c | 10 +- builtin/checkout.c | 8 builtin/log.c

[PATCH 3/3] ls-tree: remove path filtering logic in show_tree

2014-11-08 Thread Nguyễn Thái Ngọc Duy
ls-tree uses read_tree_recursive() which already does path filtering using pathspec. No need to filter one more time based on prefix only. "ls-tree ../somewhere" does not work because of this. write_name_quotedpfx() can now be retired because nobody else uses it. Signed-off-by: Nguyễn Thái Ngọc Du

[PATCH] Documentation/config.txt: fix minor typo

2014-11-08 Thread Thomas Quinot
Add a missing capital at the beginning of a sentence, and rephrase slightly. Signed-off-by: Thomas Quinot --- Documentation/config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index e8dd76d..588d024 100644 --- a/Docum

[PATCH] git_connect: allow passing arguments to ssh in GIT_SSH_ARGS

2014-11-08 Thread Thomas Quinot
It may be impractical to install a wrapper script for ssh when additional parameters need to be passed. Provide an alternative way of specifying these by means of the GIT_SSH_ARGS environment variable. Arguments are whitespace delimited following usual shell conventions; embedded whitespace can be

Re: What is the default refspec for fetch?

2014-11-08 Thread Jeff King
On Fri, Nov 07, 2014 at 04:31:08PM +0100, Christian Halstrick wrote: > In a repo where no remote..fetch config parameter is set what > should a "git fetch" do? My experiments let me think it's > "HEAD:FETCH_HEAD". Right? Basically, yes. We always write FETCH_HEAD, regardless of the refspec. We ch

[PATCH v2 22/22] untracked cache: guard and disable on system changes

2014-11-08 Thread Nguyễn Thái Ngọc Duy
If the user enables untracked cache, then - move worktree to an unsupported filesystem - or simply upgrade OS - or move the whole (portable) disk from one machine to another - or access a shared fs from another machine there's no guarantee that untracked cache can still function properly. Rec

[PATCH v2 16/22] untracked-cache: temporarily disable with $GIT_DISABLE_UNTRACKED_CACHE

2014-11-08 Thread Nguyễn Thái Ngọc Duy
This can be used to double check if results with untracked cache are correctly, compared to vanilla version. Untracked cache remains in index, but not used. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dir.c b/dir.c index b1f2b

[PATCH v2 13/22] untracked cache: avoid racy timestamps

2014-11-08 Thread Nguyễn Thái Ngọc Duy
When a directory is updated within the same second that its timestamp is last saved, we cannot realize the directory has been updated by checking timestamps. Assume the worst (something is update). See 29e4d36 (Racy GIT - 2005-12-20) for more information. Signed-off-by: Nguyễn Thái Ngọc Duy ---

[PATCH v2 17/22] status: enable untracked cache

2014-11-08 Thread Nguyễn Thái Ngọc Duy
update_index_if_able() is moved down so that the updated untracked cache could be written out. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/commit.c | 5 +++-- wt-status.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c index 5ed

[PATCH v2 08/22] untracked cache: don't open non-existent .gitignore

2014-11-08 Thread Nguyễn Thái Ngọc Duy
This cuts down a signficant number of open(.gitignore) because most directories usually don't have .gitignore files. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/dir.c b/dir.c index 32406bf..5936c84 1

[PATCH v2 12/22] read-cache.c: split racy stat test to a separate function

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/read-cache.c b/read-cache.c index 7870d4a..794176f 100644 --- a/read-cache.c +++ b/read-cache.c @@ -270,20 +270,26 @@ static int ce_match_stat_basic(c

[PATCH v2 20/22] t7063: tests for untracked cache

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- .gitignore | 1 + Makefile | 1 + t/t7063-status-untracked-cache.sh (new +x) | 353 + test-dump-untracked-cache.c (new) | 61 + 4 files changed,

[PATCH v2 21/22] mingw32: add uname()

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- compat/mingw.c | 11 +++ compat/mingw.h | 9 + 2 files changed, 20 insertions(+) diff --git a/compat/mingw.c b/compat/mingw.c index c5c37e5..b817678 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -2128,3 +2128,14 @@ void mingw_startup

[PATCH v2 11/22] untracked cache: invalidate at index addition or removal

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Ideally we should implement untracked_cache_remove_from_index() and untracked_cache_add_to_index() so that they update untracked cache right away instead of invalidating it and wait for read_directory() next time to deal with it. But that may need some more work in unpack-trees.c. So stay simple as

[PATCH v2 10/22] untracked cache: load from UNTR index extension

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c| 135 +++ dir.h| 2 + read-cache.c | 5 +++ 3 files changed, 142 insertions(+) diff --git a/dir.c b/dir.c index 4e15f20..bc196b3 100644 --- a/dir.c +++ b/dir.c @@ -2223,3 +22

[PATCH v2 09/22] untracked cache: save to an index extension

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 3 +++ dir.c| 85 dir.h| 1 + read-cache.c | 12 + 4 files changed, 101 insertions(+) diff --git a/cache.h b/cache.h index dcf3a2a..b14d6e2 100644 --- a/c

[PATCH v2 18/22] update-index: manually enable or disable untracked cache

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Overall time saving on "git status" is about 40% in the best case scenario, removing ..collect_untracked() as the most time consuming function. read and refresh index operations are now at the top (which should drop when index-helper and/or watchman support is added). More numbers and analysis belo

[PATCH v2 19/22] update-index: test the system before enabling untracked cache

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Helped-by: Eric Sunshine Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-update-index.txt | 6 ++ builtin/update-index.c | 148 + 2 files changed, 154 insertions(+) diff --git a/Documentation/git-update-index.txt b/Documentation/git-u

[PATCH v2 14/22] untracked cache: print stats with $GIT_TRACE_UNTRACKED_STATS

2014-11-08 Thread Nguyễn Thái Ngọc Duy
This could be used to verify correct behavior in tests Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 12 1 file changed, 12 insertions(+) diff --git a/dir.c b/dir.c index 52daaf7..27bd40a 100644 --- a/dir.c +++ b/dir.c @@ -1920,6 +1920,18 @@ int read_directory(struct dir_struct *

[PATCH v2 15/22] untracked cache: mark index dirty if untracked cache is updated

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 1 + dir.c| 9 + read-cache.c | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cache.h b/cache.h index f8b3dc5..201b22e 100644 --- a/cache.h +++ b/cache.h @@ -295,6 +295,7 @@ static inline unsigned int ca

[PATCH v2 07/22] untracked cache: mark what dirs should be recursed/saved

2014-11-08 Thread Nguyễn Thái Ngọc Duy
If we redo this thing in a functional style, we would have one struct untracked_dir as input tree and another as output. The input is used for verification. The output is a brand new tree, reflecting current worktree. But that means recreate a lot of dir nodes even if a lot could be shared between

[PATCH v2 00/22] untracked cache updates

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Updated based on comments from the list, including three new patches: - 16/22 allows to ignore untracked cache without destroying it (for comparison and verification) - 21/22 and 22/22 add some protection against filesystem or operating system changes Also fix 'update-index --untracked-ca

[PATCH v2 06/22] untracked cache: record/validate dir mtime and reuse cached output

2014-11-08 Thread Nguyễn Thái Ngọc Duy
The main readdir loop in read_directory_recursive() is replaced with a new one that checks if cached results of a directory is still valid. If a file is added or removed from the index, the containing directory is invalidated (but not its subdirs). If directory's mtime is changed, the same happens

[PATCH v2 05/22] untracked cache: make a wrapper around {open,read,close}dir()

2014-11-08 Thread Nguyễn Thái Ngọc Duy
This allows us to feed different info to read_directory_recursive() based on untracked cache in the next patch. Helped-by: Ramsay Jones Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 55 +++ 1 file changed, 47 insertions(+), 8 deletions(-) d

[PATCH v2 04/22] untracked cache: invalidate dirs recursively if .gitignore changes

2014-11-08 Thread Nguyễn Thái Ngọc Duy
It's easy to see that if an existing .gitignore changes, its SHA-1 would be different and invalidate_gitignore() is called. If .gitignore is removed, add_excludes() will treat it like an empty .gitignore, which again should invalidate the cached directory data. if .gitignore is added, lookup_untr

[PATCH v2 02/22] untracked cache: record .gitignore information and dir hierarchy

2014-11-08 Thread Nguyễn Thái Ngọc Duy
The idea is if we can capture all input and (non-rescursive) output of read_directory_recursive(), and can verify later that all the input is the same, then the second r_d_r() should produce the same output as in the first run. The requirement for this to work is stat info of a directory MUST chan

[PATCH v2 01/22] dir.c: optionally compute sha-1 of a .gitignore file

2014-11-08 Thread Nguyễn Thái Ngọc Duy
This is not used anywhere yet. But the goal is to compare quickly if a .gitignore file has changed when we have the SHA-1 of both old (cached somewhere) and new (from index or a tree) versions. Helped-by: Junio C Hamano Helped-by: Torsten Bögershausen Signed-off-by: Nguyễn Thái Ngọc Duy --- di

[PATCH v2 03/22] untracked cache: initial untracked cache validation

2014-11-08 Thread Nguyễn Thái Ngọc Duy
Make sure the starting conditions and all global exclude files are good to go. If not, either disable untracked cache completely, or wipe out the cache and start fresh. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 113 -- dir.h |

Re: [RFC] git checkout $tree -- $path always rewrites files

2014-11-08 Thread Jeff King
On Sat, Nov 08, 2014 at 03:30:40AM -0500, Jeff King wrote: > So just to be clear, the behavior we want is that: > > echo foo >some-new-path > git add some-new-path > git checkout HEAD -- . > > will delete some-new-path (whereas the current code turns it into an > untracked file). What shou

Re: [RFC] git checkout $tree -- $path always rewrites files

2014-11-08 Thread Jeff King
On Fri, Nov 07, 2014 at 11:35:59PM -0800, Junio C Hamano wrote: > I think that has direct linkage; what you have in mind I think is > http://thread.gmane.org/gmane.comp.version-control.git/234903/focus=234935 Thanks for that link. I did spend a few hours on this topic earlier today, and got very

Re: [RFC] git checkout $tree -- $path always rewrites files

2014-11-08 Thread Martin von Zweigbergk
I'm not sure I had seen that particular thread, but it seems like we're all in agreement on that topic. I'm keeping my fingers crossed that Jeff will have time to tackle that this time :-) On Fri, Nov 7, 2014 at 11:35 PM, Junio C Hamano wrote: > I think that has direct linkage; what you have in m