[PATCH v6 03/27] files-backend: delete dead code in files_init_db()

2017-03-17 Thread Nguyễn Thái Ngọc Duy
safe_create_dir() can do adjust_shared_perm() internally, and init-db has always created 'refs' in shared mode since the beginning, af6e277c5e (git-init-db: initialize shared repositories with --shared - 2005-12-22). So this code looks like extra adjust_shared_perm calls are unnecessary. And they

Re: Bug with .gitignore and branch switching

2017-03-17 Thread Nevada Sanchez
On Fri, Mar 17, 2017 at 5:23 PM, Junio C Hamano wrote: > Nevada Sanchez writes: > >> Here's an easy to reproduce bug. It's the only example I know of where >> git legitimately loses data in a way that is unrecoverable, >> unexpected, and without

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] gitk: Add Chinese(zh_CN) translation

2017-03-17 Thread Jiang Xin
Hi Yanke, You should send this patch to the gitk maintainer, not here. Gitk has a separate repository, which has its own workflow according to "Documentation/SubmittingPatches": Some parts of the system have dedicated maintainers with their own repositories. ...

[PATCH v6 01/27] refs.h: add forward declaration for structs used in this file

2017-03-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.h | 4 1 file changed, 4 insertions(+) diff --git a/refs.h b/refs.h index 3df0d45ebb..2d6b6263fc 100644 --- a/refs.h +++ b/refs.h @@ -1,6 +1,10 @@ #ifndef REFS_H #define REFS_H +struct object_id; +struct strbuf; +struct

[PATCH v6 00/27] Remove submodule from files-backend.c

2017-03-17 Thread Nguyễn Thái Ngọc Duy
v6 should address all Micheal's comments in v5, except a few that I replied back. The interdiff looks a bit messy due to some new refactoring (05/27) in files_rename_ref(), but it makes the final output easier to read. 03/27 and 27/27 are also new patches that are not really necessary but nice to

[PATCH v6 02/27] files-backend: make files_log_ref_write() static

2017-03-17 Thread Nguyễn Thái Ngọc Duy
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 Duy --- refs/files-backend.c | 3 +++ refs/refs-internal.h | 4 2 files changed, 3 insertions(+), 4 deletions(-) diff

[PATCH v6 04/27] files-backend: add and use files_packed_refs_path()

2017-03-17 Thread Nguyễn Thái Ngọc Duy
Keep repo-related path handling in one place. This will make it easier to add submodule/multiworktree support later. Signed-off-by: Nguyễn Thái Ngọc Duy --- refs/files-backend.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git

[PATCH v6 20/27] refs: add new ref-store api

2017-03-17 Thread Nguyễn Thái Ngọc Duy
This is not meant to cover all existing API. It adds enough to test ref stores with the new test program test-ref-store, coming soon and to be used by files-backend.c. Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 251

[PATCH v6 18/27] files-backend: replace submodule_allowed check in files_downcast()

2017-03-17 Thread Nguyễn Thái Ngọc Duy
files-backend.c is unlearning submodules. Instead of having a specific check for submodules to see what operation is allowed, files backend now takes a set of flags at init. Each operation will check if the required flags is present before performing. For now we have four flags: read, write and

[PATCH v6 21/27] refs: new transaction related ref-store api

2017-03-17 Thread Nguyễn Thái Ngọc Duy
The transaction struct now takes a ref store at creation and will operate on that ref store alone. Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 55 refs.h | 9 + refs/refs-internal.h

[PATCH v6 19/27] refs: rename get_ref_store() to get_submodule_ref_store() and make it public

2017-03-17 Thread Nguyễn Thái Ngọc Duy
This function is intended to replace *_submodule() refs API. It provides a ref store for a specific submodule, which can be operated on by a new set of refs API. Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 12 refs.h | 11

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

2017-03-17 Thread Junio C Hamano
Stefan Beller writes: > -List details of each worktree. The main worktree is listed first, followed > by > -each of the linked worktrees. The output details include if the worktree is > -bare, the revision currently checked out, and the branch currently checked > out >

[PATCH v6 22/27] files-backend: avoid ref api targetting main ref store

2017-03-17 Thread Nguyễn Thái Ngọc Duy
A small step towards making files-backend works as a non-main ref store using the newly added store-aware API. For the record, `join` and `nm` on refs.o and files-backend.o tell me that files-backend no longer uses functions that defaults to get_main_ref_store(). I'm not yet comfortable at the

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

2017-03-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t1406-submodule-ref-store.sh (new +x) | 95 + 1 file changed, 95 insertions(+) create mode 100755 t/t1406-submodule-ref-store.sh diff --git a/t/t1406-submodule-ref-store.sh

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

2017-03-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Makefile| 1 + t/helper/.gitignore | 1 + t/helper/test-ref-store.c (new) | 275 3 files changed, 277 insertions(+) create mode 100644

[PATCH v6 25/27] t1405: some basic tests on main ref store

2017-03-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t1405-main-ref-store.sh (new +x) | 123 + 1 file changed, 123 insertions(+) create mode 100755 t/t1405-main-ref-store.sh diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh new file

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

2017-03-17 Thread Nguyễn Thái Ngọc Duy
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* Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 35 +++ submodule.c | 36

[PATCH v6 27/27] refs.h: add a note about sorting order of for_each_ref_*

2017-03-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.h | 4 ++-- t/t1405-main-ref-store.sh | 6 ++ t/t1406-submodule-ref-store.sh | 6 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/refs.h b/refs.h index 1a07f9d86f..49e97d7d5f

[PATCH v6 12/27] refs: rename lookup_ref_store() to lookup_submodule_ref_store()

2017-03-17 Thread Nguyễn Thái Ngọc Duy
With get_main_ref_store() being used inside get_ref_store(), lookup_ref_store() is only used for submodule code path. Rename to reflect that and delete dead code. Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 13 - 1 file changed, 4 insertions(+), 9

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

2017-03-17 Thread Nguyễn Thái Ngọc Duy
files-backend is now initialized with a $GIT_DIR. Converting a submodule path to where real submodule gitdir is located is done in get_ref_store(). This gives a slight performance improvement for submodules since we don't convert submodule path to gitdir at every backend call like before. We pay

[PATCH v6 08/27] files-backend: add and use files_reflog_path()

2017-03-17 Thread Nguyễn Thái Ngọc Duy
Keep repo-related path handling in one place. This will make it easier to add submodule/multiworktree support later. Signed-off-by: Nguyễn Thái Ngọc Duy --- refs/files-backend.c | 142 +++ 1 file changed, 86 insertions(+), 56

[PATCH v6 13/27] refs.c: flatten get_ref_store() a bit

2017-03-17 Thread Nguyễn Thái Ngọc Duy
This helps the future changes in this code. And because get_ref_store() is destined to become get_submodule_ref_store(), the "get main store" code path will be removed eventually. After this the patch to delete that code will be cleaner. Signed-off-by: Nguyễn Thái Ngọc Duy ---

[PATCH v6 11/27] refs.c: introduce get_main_ref_store()

2017-03-17 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c index e7606716dd..2637353b72 100644 --- a/refs.c +++ b/refs.c @@ -1456,15 +1456,23 @@ static struct ref_store

[PATCH v6 23/27] refs: delete pack_refs() in favor of refs_pack_refs()

2017-03-17 Thread Nguyễn Thái Ngọc Duy
It only has one caller, not worth keeping just for convenience. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/pack-refs.c | 2 +- refs.c | 5 - refs.h | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/builtin/pack-refs.c

[PATCH v6 14/27] refs.c: kill register_ref_store(), add register_submodule_ref_store()

2017-03-17 Thread Nguyễn Thái Ngọc Duy
This is the last function in this code (besides public API) that takes submodule argument and handles both main/submodule cases. Break it down, move main store registration in get_main_ref_store() and keep the rest in register_submodule_ref_store(). Signed-off-by: Nguyễn Thái Ngọc Duy

[PATCH v6 06/27] files-backend: convert git_path() to strbuf_git_path()

2017-03-17 Thread Nguyễn Thái Ngọc Duy
git_path() and friends are going to be killed in files-backend.c in near future. And because there's a risk with overwriting buffer in git_path(), let's convert them all to strbuf_git_path(). We'll have easier time killing/converting strbuf_git_path() then because we won't have to worry about

[PATCH v6 15/27] refs.c: make get_main_ref_store() public and use it

2017-03-17 Thread Nguyễn Thái Ngọc Duy
get_ref_store() will soon be renamed to get_submodule_ref_store(). Together with future get_worktree_ref_store(), the three functions provide an appropriate ref store for different operation modes. New APIs will be added to operate directly on ref stores. Signed-off-by: Nguyễn Thái Ngọc Duy

[PATCH v6 09/27] files-backend: add and use files_refname_path()

2017-03-17 Thread Nguyễn Thái Ngọc Duy
Keep repo-related path handling in one place. This will make it easier to add submodule/multiworktree support later. This automatically adds the "if submodule then use the submodule version of git_path" to other call sites too. But it does not mean those operations are submodule-ready. Not yet.

[PATCH v6 05/27] files-backend: make sure files_rename_ref() always reach the end

2017-03-17 Thread Nguyễn Thái Ngọc Duy
This is a no-op patch. It prepares the function so that we can release resources (to be added later in this function) before we return. Signed-off-by: Nguyễn Thái Ngọc Duy --- refs/files-backend.c | 42 -- 1 file changed, 28

[PATCH v6 10/27] files-backend: remove the use of git_path()

2017-03-17 Thread Nguyễn Thái Ngọc Duy
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 linked worktree is a logical ref store that combines two files backends together. (*) Not entirely true since strbuf_git_path_submodule()

[PATCH v6 07/27] files-backend: move "logs/" out of TMP_RENAMED_LOG

2017-03-17 Thread Nguyễn Thái Ngọc Duy
This makes reflog path building consistent, always in the form of strbuf_git_path(sb, "logs/%s", refname); It reduces the mental workload a bit in the next patch when that function call is converted. Signed-off-by: Nguyễn Thái Ngọc Duy --- refs/files-backend.c | 10

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

2017-03-17 Thread Junio C Hamano
Jonathan Nieder writes: > I'm not sure I agree with this distinction. "worktree" is just a > short name for "working tree". That is probably primarily my fault. Loong before the "git worktree" that is meant to replace the "workdir" thing in contrib/ was invented,

[PATCH v5 10/10] submodule add: respect submodule.active and submodule..active

2017-03-17 Thread Brandon Williams
In addition to adding submodule..url to the config, set submodule..active to true unless submodule.active is configured and the submodule's path matches the configured pathspec. Signed-off-by: Brandon Williams --- git-submodule.sh | 14 ++

[PATCH v5 00/10] decoupling url and submodule interest

2017-03-17 Thread Brandon Williams
Changes in v5: * Add "NEEDSWORK" comments to indicate where attention is needed once per-worktree config is a reality * --no-recurse now works by clearing the string list of paths. * module_list_active() now does post-processing instead of duplicating code. Brandon Williams (10):

[PATCH] http-push: don't check return value of lookup_unknown_object()

2017-03-17 Thread René Scharfe
This function always returns a reference to an object, creating one if needed, so remove the unnecessary NULL check. Signed-off-by: Rene Scharfe --- http-push.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/http-push.c b/http-push.c index

[PATCH v5 04/10] submodule sync: use submodule--helper is-active

2017-03-17 Thread Brandon Williams
Signed-off-by: Brandon Williams --- git-submodule.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 577136148..db94dea3b 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1089,14 +1089,14 @@ cmd_sync()

[PATCH v5 07/10] submodule init: initialize active submodules

2017-03-17 Thread Brandon Williams
Teach `submodule init` to initialize submodules which have been configured to be active by setting 'submodule.active' with a pathspec. Now if no path arguments are given and 'submodule.active' is configured, `init` will initialize all submodules which have been configured to be active. If no

[PATCH v5 01/10] submodule--helper: add is-active subcommand

2017-03-17 Thread Brandon Williams
The definition of which submodules are of interest by the user is tied to the configuration submodule..url; when it is set to a non-empty string, it is of interest. We'd want to be able to later change this definition, but there are many places that explicitly check this condition in the scripted

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

2017-03-17 Thread Jonathan Nieder
Hi, Stefan Beller wrote: > If I recall correctly, "worktree" is the feature/command, and > "working tree" is an instance in the file system, even when you only > have one working tree. I'm not sure I agree with this distinction. "worktree" is just a short name for "working tree".

Re: [PATCH] receive-pack: simplify run_update_post_hook()

2017-03-17 Thread Jonathan Nieder
René Scharfe wrote: > Instead of counting the arguments to see if there are any and then > building the full command use a single loop and add the hook command > just before the first argument. This reduces duplication and overall > code size. > > Signed-off-by: Rene Scharfe > ---

Re: [PATCH] grep: fix build with no thread support

2017-03-17 Thread Jeff King
On Fri, Mar 17, 2017 at 03:42:32PM -0700, Brandon Williams wrote: > > > I didn't take a close look at it but this would seem to indicate that we > > > don't worry to much about systems without pthreads support. Just food > > > for thought. > > > > Hmm. We used to. What version did you test?

[PATCH] shortlog: don't set after_subject to an empty string

2017-03-17 Thread René Scharfe
The string after_subject is added to a strbuf by pp_title_line() if it's not NULL. Adding an empty string has the same effect as not adding anything, but the latter is easier, so don't bother changing the context member from NULL to "". Signed-off-by: Rene Scharfe ---

Re: [PATCH] run-command: fix segfault when cleaning forked async process

2017-03-17 Thread Brandon Williams
On 03/17, Jeff King wrote: > Callers of the run-command API may mark a child as > "clean_on_exit"; it gets added to a list and killed when the > main process dies. Since commit 46df6906f > (execv_dashed_external: wait for child on signal death, > 2017-01-06), we respect an extra

Re: [PATCH] run-command: fix segfault when cleaning forked async process

2017-03-17 Thread Jonathan Nieder
Jeff King wrote: > Reported-by: Brandon Williams > Signed-off-by: Jeff King Reviewed-by: Jonathan Nieder Thanks.

[PATCH v5 08/10] clone: teach --recurse-submodules to optionally take a pathspec

2017-03-17 Thread Brandon Williams
Teach clone --recurse-submodules to optionally take a pathspec argument which describes which submodules should be recursively initialized and cloned. If no pathspec is provided, --recurse-submodules will recursively initialize and clone all submodules by using a default pathspec of ".". In

Re: [PATCH] receive-pack: simplify run_update_post_hook()

2017-03-17 Thread René Scharfe
Am 17.03.2017 um 23:23 schrieb Jeff King: On Fri, Mar 17, 2017 at 11:02:13PM +0100, René Scharfe wrote: Instead of counting the arguments to see if there are any and then building the full command use a single loop and add the hook command just before the first argument. This reduces

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

2017-03-17 Thread Stefan Beller
On Fri, Mar 17, 2017 at 3:55 PM, Jonathan Nieder wrote: > Hi, > > Stefan Beller wrote: > >> If I recall correctly, "worktree" is the feature/command, and >> "working tree" is an instance in the file system, even when you only >> have one working tree. > > I'm not sure I agree

Re: [PATCH v4 07/10] submodule init: initialize active submodules

2017-03-17 Thread Stefan Beller
>> Here we also need to have >> >> git_config(submodule_config, NULL); >> >> such that is_submodule_initialized works correctly, >> I would assume? > > No I don't think so. is_submodule_initialized doesn't need them to be > overlayed, it just needs the .gitmodules mappings. ok, thanks! I

Re: [PATCH v5 00/10] decoupling url and submodule interest

2017-03-17 Thread Stefan Beller
On Fri, Mar 17, 2017 at 3:37 PM, Brandon Williams wrote: > Changes in v5: > * Add "NEEDSWORK" comments to indicate where attention is needed once > per-worktree config is a reality > * --no-recurse now works by clearing the string list of paths. > *

Re: [PATCH] receive-pack: simplify run_update_post_hook()

2017-03-17 Thread Jeff King
On Fri, Mar 17, 2017 at 11:02:13PM +0100, René Scharfe wrote: > Instead of counting the arguments to see if there are any and then > building the full command use a single loop and add the hook command > just before the first argument. This reduces duplication and overall > code size. Yeah, I

[PATCH] run-command: fix segfault when cleaning forked async process

2017-03-17 Thread Jeff King
Callers of the run-command API may mark a child as "clean_on_exit"; it gets added to a list and killed when the main process dies. Since commit 46df6906f (execv_dashed_external: wait for child on signal death, 2017-01-06), we respect an extra "wait_after_clean" flag, which we expect to find in

[PATCH v5 03/10] submodule sync: skip work for inactive submodules

2017-03-17 Thread Brandon Williams
Sync does some work determining what URLs should be used for a submodule but then throws this work away if the submodule isn't active. Instead perform the activity check earlier and skip inactive submodule in order to avoid doing unnecessary work. Signed-off-by: Brandon Williams

Re: fatal: Could not get current working directory: Permission denied | affected 2.10,2.11,2.12, but not 1.9.5 |

2017-03-17 Thread René Scharfe
Am 17.03.2017 um 23:29 schrieb Jeff King: On Fri, Mar 17, 2017 at 10:07:18PM +0100, René Scharfe wrote: As an extension to the POSIX.1-2001 standard, Linux (libc4, libc5, glibc) getcwd() allocates the buffer dynamically using malloc(3) if buf is NULL. In this case, the allocated buffer

[PATCH v5 02/10] submodule status: use submodule--helper is-active

2017-03-17 Thread Brandon Williams
Signed-off-by: Brandon Williams --- git-submodule.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 136e26a2c..ab233712d 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1010,14 +1010,13 @@ cmd_status()

Re: [PATCH] grep: fix build with no thread support

2017-03-17 Thread Brandon Williams
On 03/17, Jeff King wrote: > On Fri, Mar 17, 2017 at 03:42:32PM -0700, Brandon Williams wrote: > > > > > I didn't take a close look at it but this would seem to indicate that we > > > > don't worry to much about systems without pthreads support. Just food > > > > for thought. > > > > > > Hmm.

Re: [PATCH 2/2] grep: fix builds with with no thread support

2017-03-17 Thread Jonathan Nieder
Brandon Williams wrote: > Commit 0281e487fd91 ("grep: optionally recurse into submodules") > added functions grep_submodule() and grep_submodule_launch() which > uses "struct work_item" which is defined only when thread support nit: which use (s/uses/use/) > is available. [...] > Reported-by:

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

2017-03-17 Thread Stefan Beller
If I recall correctly, "worktree" is the feature/command, and "working tree" is an instance in the file system, even when you only have one working tree. Using that mental model, the documentation for 'git worktree list' clearly talks about working trees, so fix it. Reflow the lines as well.

[PATCH v5 09/10] submodule--helper init: set submodule..active

2017-03-17 Thread Brandon Williams
When initializing a submodule set the submodule..active config to true if the module hasn't already been configured to be active by some other means (e.g. a pathspec set in submodule.active). Signed-off-by: Brandon Williams --- builtin/submodule--helper.c | 12

[PATCH v5 05/10] submodule--helper clone: check for configured submodules using helper

2017-03-17 Thread Brandon Williams
Use the 'is_submodule_initialized()' helper to check for configured submodules instead of manually checking for the submodule's URL in the config. Signed-off-by: Brandon Williams --- builtin/submodule--helper.c | 15 +++ 1 file changed, 3 insertions(+), 12

[PATCH v5 06/10] submodule: decouple url and submodule interest

2017-03-17 Thread Brandon Williams
Currently the submodule..url config option is used to determine if a given submodule is of interest to the user. This ends up being cumbersome in a world where we want to have different submodules checked out in different worktrees or a more generalized mechanism to select which submodules are of

Re: [PATCH 2/2] name-rev: favor describing with tags and use committer date to tiebreak

2017-03-17 Thread Junio C Hamano
Junio C Hamano writes: > Lars Schneider writes: > ... >> Following your explanation this patch looks good to me and this fixes the >> test failure. TBH I never thought about the difference of these commands >> before. "rev" and "ref" sound so similar

Re: [PATCH] grep: fix build with no thread support

2017-03-17 Thread Brandon Williams
On 03/17, Jeff King wrote: > On Fri, Mar 17, 2017 at 11:47:01AM -0700, Brandon Williams wrote: > > > While taking a look at this bug I discovered that the test suite doesn't > > pass 100% of the test when compiled with the NO_PTHREADS option. The > > following tests seem to be failing: > > > >

Re: [PATCH] grep: fix build with no thread support

2017-03-17 Thread Jeff King
On Fri, Mar 17, 2017 at 11:47:01AM -0700, Brandon Williams wrote: > While taking a look at this bug I discovered that the test suite doesn't > pass 100% of the test when compiled with the NO_PTHREADS option. The > following tests seem to be failing: > > t1060-object-corruption.sh

Re: Bug with .gitignore and branch switching

2017-03-17 Thread Junio C Hamano
Jonathan Nieder writes: > The most recent example I can find is 2010: > http://public-inbox.org/git/4c6a1c5b.4030...@workspacewhiz.com/. > > It also came up in 2007: > http://public-inbox.org/git/c0e9f681e68d48eb8989022d11fee...@ntdev.corp.microsoft.com/ > Earlier in that

Re: fatal: Could not get current working directory: Permission denied | affected 2.10,2.11,2.12, but not 1.9.5 |

2017-03-17 Thread Jeff King
On Fri, Mar 17, 2017 at 10:07:18PM +0100, René Scharfe wrote: > > As an extension to the POSIX.1-2001 standard, Linux (libc4, libc5, > > glibc) getcwd() > > allocates the buffer dynamically using malloc(3) if buf is NULL. In > > this case, the > > allocated buffer has the length size

Re: [PATCH v4 07/10] submodule init: initialize active submodules

2017-03-17 Thread Brandon Williams
On 03/17, Stefan Beller wrote: > On Thu, Mar 16, 2017 at 3:29 PM, Brandon Williams wrote: > > Teach `submodule init` to initialize submodules which have been > > configured to be active by setting 'submodule.active' with a pathspec. > > > > Now if no path arguments are given

Re: [PATCHv4] rev-parse: add --show-superproject-working-tree

2017-03-17 Thread Jonathan Nieder
Hi, Stefan Beller wrote: > Add the flag --show-superproject-working-tree to git-rev-parse > to make it easy to find out if there is a superproject. When no > superproject exists, the output will be empty. I'm a little late for this, but think it's better to comment late than never. After this

Re: [PATCH] revision: remove declaration of path_name()

2017-03-17 Thread Jeff King
On Fri, Mar 17, 2017 at 11:15:03PM +0100, René Scharfe wrote: > The definition of path_name() was removed by 2824e1841 (list-objects: > pass full pathname to callbacks); remove its declaration as well. Yep, this should have been done back then. Thanks. -Peff

Re: Bug with .gitignore and branch switching

2017-03-17 Thread Stefan Beller
On Fri, Mar 17, 2017 at 2:23 PM, Junio C Hamano wrote: > We've discussed the lack of "untracked but precious" class a few > times on the list in the past, but I do not recall the topic came up > in the recent past. It perhaps is because nobody found that class > useful enough

[PATCH] revision: remove declaration of path_name()

2017-03-17 Thread René Scharfe
The definition of path_name() was removed by 2824e1841 (list-objects: pass full pathname to callbacks); remove its declaration as well. Signed-off-by: Rene Scharfe --- revision.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/revision.h b/revision.h index

Re: Did you get my several email?

2017-03-17 Thread Bar. Nasir Mehmood Raja
Attention, I have tried to contact you severally without success, I hope you get my message this time and respond immediately regarding the money and my lucrative proposal. I would send you a detailed email as soon as I receive your timely response, I have not contacted you by mistake so do not

[PATCH] receive-pack: simplify run_update_post_hook()

2017-03-17 Thread René Scharfe
Instead of counting the arguments to see if there are any and then building the full command use a single loop and add the hook command just before the first argument. This reduces duplication and overall code size. Signed-off-by: Rene Scharfe --- builtin/receive-pack.c | 13

Re: Bug with .gitignore and branch switching

2017-03-17 Thread Jonathan Nieder
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 latter. [...] > We've discussed the lack of "untracked but precious" class a few > times

Re: [PATCH v4 09/10] submodule--helper init: set submodule..active

2017-03-17 Thread Brandon Williams
On 03/17, Stefan Beller wrote: > On Thu, Mar 16, 2017 at 3:29 PM, Brandon Williams wrote: > > When initializing a submodule set the submodule..active config to > > true if the module hasn't already been configured to be active by some > > other means (e.g. a pathspec set in

Re: Bug with .gitignore and branch switching

2017-03-17 Thread Jonathan Nieder
Hi Nevada, Nevada Sanchez wrote: > # Commit a file that will end up in .gitignore > echo 'original settings' > mine.conf > git add mine.conf > git commit -m "Unknowingly committed my settings." > > echo '*.conf' > .gitignore > git add .gitignore > git commit -m "Users shouldn't commit their

Re: Bug with .gitignore and branch switching

2017-03-17 Thread Junio C Hamano
Nevada Sanchez writes: > Here's an easy to reproduce bug. It's the only example I know of where > git legitimately loses data in a way that is unrecoverable, > unexpected, and without warning. This is an example of a user explicitly telling git to discard data and git

What's cooking in git.git (Mar 2017, #07; Fri, 17)

2017-03-17 Thread Junio C Hamano
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. Quite a few topics have graduated

Re: [PATCH v4 08/10] clone: teach --recurse-submodules to optionally take a pathspec

2017-03-17 Thread Brandon Williams
On 03/17, Stefan Beller wrote: > On Thu, Mar 16, 2017 at 3:29 PM, Brandon Williams wrote: > > Teach clone --recurse-submodules to optionally take a pathspec argument > > which describes which submodules should be recursively initialized and > > cloned. If no pathspec is

Re: fatal: Could not get current working directory: Permission denied | affected 2.10,2.11,2.12, but not 1.9.5 |

2017-03-17 Thread René Scharfe
Am 17.03.2017 um 20:45 schrieb Stefan Beller: On Fri, Mar 17, 2017 at 12:34 PM, René Scharfe wrote: Am 15.03.2017 um 22:30 schrieb René Scharfe: Am 15.03.2017 um 10:44 schrieb Zenobiusz Kunegunda: $ git bisect bad 7333ed1788b4f2b162a35003044d77a716732a1f is the first bad commit

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Junio C Hamano
Brandon Williams writes: > I don't think that prefix can ever have ".." in it. From what I > understand it is always a path from the root of the repository to the > cwd that the git command was invoked by. So in your example prefix > would be "src/". The prefix would be

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
On 03/17, Junio C Hamano wrote: > Brandon Williams writes: > > > ... I was being cautious with this patch since git didn't currently > > read GIT_PREFIX. > > Ahh, I forgot about that. Processes we spawn do expect GIT_PREFIX > to tell them where the original $cwd was and

Bug with .gitignore and branch switching

2017-03-17 Thread Nevada Sanchez
Here's an easy to reproduce bug. It's the only example I know of where git legitimately loses data in a way that is unrecoverable, unexpected, and without warning. ``` git --version # git version 2.12.0 mkdir git-demo cd git-demo git init # Commit a file that will end up in .gitignore echo

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Junio C Hamano
Brandon Williams writes: > ... I was being cautious with this patch since git didn't currently > read GIT_PREFIX. Ahh, I forgot about that. Processes we spawn do expect GIT_PREFIX to tell them where the original $cwd was and they also do expect that "git" invoked by them

Re: fatal: Could not get current working directory: Permission denied | affected 2.10,2.11,2.12, but not 1.9.5 |

2017-03-17 Thread Stefan Beller
On Fri, Mar 17, 2017 at 12:34 PM, René Scharfe wrote: > Am 15.03.2017 um 22:30 schrieb René Scharfe: >> Am 15.03.2017 um 10:44 schrieb Zenobiusz Kunegunda: >>> $ git bisect bad >>> 7333ed1788b4f2b162a35003044d77a716732a1f is the first bad commit >>> commit

Re: fatal: Could not get current working directory: Permission denied | affected 2.10,2.11,2.12, but not 1.9.5 |

2017-03-17 Thread René Scharfe
Am 15.03.2017 um 22:30 schrieb René Scharfe: > Am 15.03.2017 um 10:44 schrieb Zenobiusz Kunegunda: >> $ git bisect bad >> 7333ed1788b4f2b162a35003044d77a716732a1f is the first bad commit >> commit 7333ed1788b4f2b162a35003044d77a716732a1f >> Author: René Scharfe >> Date: Mon Jul 28

Re: [GSoC][PATCH v5 2/3] credential-cache: use XDG_CACHE_HOME for socket

2017-03-17 Thread Devin Lehmacher
> or $HOME/.cache/git/credential/socket if $XDG_CACHE_HOME is not set. > I don't have a good suggestion to re-word this paragraph. (I just > spent ten minutes trying!). I think it would not be too bad to not include this though because `$HOME/.cache/` is what XDG specifies as the default if

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
On 03/17, Junio C Hamano wrote: > Stefan Beller writes: > > >> prefix = setup_git_directory_gently_1(nongit_ok); > >> + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); > >> + > >> + if (env_prefix) > >> + prefix = env_prefix; > >> + >

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
On 03/17, Stefan Beller wrote: > > prefix = setup_git_directory_gently_1(nongit_ok); > > + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); > > + > > + if (env_prefix) > > + prefix = env_prefix; > > + > > if (prefix) > >

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Stefan Beller
On Fri, Mar 17, 2017 at 12:08 PM, Brandon Williams wrote: > On 03/17, Stefan Beller wrote: >> > prefix = setup_git_directory_gently_1(nongit_ok); >> > + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); >> > + >> > + if (env_prefix) >> > +

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Brandon Williams
On 03/17, Stefan Beller wrote: > On Fri, Mar 17, 2017 at 12:08 PM, Brandon Williams wrote: > > On 03/17, Stefan Beller wrote: > >> > prefix = setup_git_directory_gently_1(nongit_ok); > >> > + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); > >> > + > >> > +

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Junio C Hamano
Stefan Beller writes: >> prefix = setup_git_directory_gently_1(nongit_ok); >> + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); >> + >> + if (env_prefix) >> + prefix = env_prefix; >> + >> if (prefix) >>

Re: [PATCH v3 2/5] setup: allow for prefix to be passed to git commands

2017-03-17 Thread Stefan Beller
> prefix = setup_git_directory_gently_1(nongit_ok); > + env_prefix = getenv(GIT_TOPLEVEL_PREFIX_ENVIRONMENT); > + > + if (env_prefix) > + prefix = env_prefix; > + > if (prefix) > setenv(GIT_PREFIX_ENVIRONMENT, prefix, 1); so we load that

Re: [PATCH] grep: fix build with no thread support

2017-03-17 Thread Brandon Williams
While taking a look at this bug I discovered that the test suite doesn't pass 100% of the test when compiled with the NO_PTHREADS option. The following tests seem to be failing: t1060-object-corruption.sh (Wstat: 256 Tests: 13 Failed: 3) Failed tests: 7-9 Non-zero exit

[PATCH 2/2] grep: fix builds with with no thread support

2017-03-17 Thread Brandon Williams
Commit 0281e487fd91 ("grep: optionally recurse into submodules") added functions grep_submodule() and grep_submodule_launch() which uses "struct work_item" which is defined only when thread support is available. The original implementation of grep_submodule() used the "struct work_item" in order

[PATCH 1/2] grep: set default output method

2017-03-17 Thread Brandon Williams
Signed-off-by: Brandon Williams --- grep.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/grep.c b/grep.c index 0dbdc1d00..56ef0ecbf 100644 --- a/grep.c +++ b/grep.c @@ -12,6 +12,11 @@ static int grep_source_is_binary(struct grep_source *gs);

Re: Shared repositories no longer securable against privilege escalation

2017-03-17 Thread Junio C Hamano
Michael Haggerty writes: > The locking was added intentionally, to ensure that the reflog for > `HEAD` is written safely. But the code didn't do that prior to the > commit that you referenced, so (as a special case) ignoring failures to > lock `HEAD` due to insufficient

Re: [PATCH] grep: fix build with no thread support

2017-03-17 Thread Brandon Williams
On 03/17, Junio C Hamano wrote: > Rahul Bedarkar writes: > > > diff --git a/builtin/grep.c b/builtin/grep.c > > index 2c727ef..4373d79 100644 > > --- a/builtin/grep.c > > +++ b/builtin/grep.c > > @@ -183,11 +183,13 @@ static void *run(void *arg) > > if (!w)

Re: Shared repositories no longer securable against privilege escalation

2017-03-17 Thread Junio C Hamano
Joe Rayhawk writes: > that, at least on base POSIX, using --shared to share a repository > between multiple UIDs literally eliminates the purpose of having > multiple UIDs. I do not think the world is _that_ blank-and-white. If you cannot trust those who push to the

Re: [PATCH v4 07/10] submodule init: initialize active submodules

2017-03-17 Thread Stefan Beller
On Thu, Mar 16, 2017 at 3:29 PM, Brandon Williams wrote: > Teach `submodule init` to initialize submodules which have been > configured to be active by setting 'submodule.active' with a pathspec. > > Now if no path arguments are given and 'submodule.active' is configured, >

  1   2   >