[PATCH 3/3] gitk: merge views with existing ones

2014-09-10 Thread Max Kirillov
Only new and modified views are saved; old ones are saved also if there are no new, modified or deleted view with same name. This allows editing view list in concurrent gitk sessions without losing the changes. Signed-off-by: Max Kirillov --- gitk | 42 +++---

[PATCH 1/3] gitk refactor: remove boilerplate for configuration variables

2014-09-10 Thread Max Kirillov
Signed-off-by: Max Kirillov --- gitk | 88 1 file changed, 20 insertions(+), 68 deletions(-) diff --git a/gitk b/gitk index 6fb6cb3..6069afe 100755 --- a/gitk +++ b/gitk @@ -2805,23 +2805,11 @@ proc doprogupdate {} { } proc

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

2014-09-10 Thread Max Kirillov
gitk rewrites whole its config on exit. This is inconvenient when there are several instances running - if user changes something in one instance, it may be discarded depending of the order of closing that instances. Change saving so that it saves only changed data and tried to preserve other exis

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

2014-09-10 Thread Max Kirillov
If a variable is changed in a concurrent gitk or manually it is preserved unless it has changed in this instance This change does not affect geometry and views save; geometry does not need it, and views need special merging, which treats each view separately rather that fully replace the shole lis

[PATCH 19/19] ref_transaction_commit: bail out on failure to remove a ref

2014-09-10 Thread Jonathan Nieder
When removal of a loose or packed ref fails, bail out instead of trying to finish the transaction. This way, a single error message can be printed (instead of multiple messages being concatenated by mistake) and the operator can try to solve the underlying problem before there is a chance to muck

[PATCH 14/19] branch -d: avoid repeated symref resolution

2014-09-10 Thread Jonathan Nieder
If a repository gets in a broken state with too much symref nesting, it cannot be repaired with "git branch -d": $ git symbolic-ref refs/heads/nonsense refs/heads/nonsense $ git branch -d nonsense error: branch 'nonsense' not found. Worse, "git update-ref --no-deref -d" doesn't work for such r

[PATCH 18/19] lockfile: remove unable_to_lock_error

2014-09-10 Thread Jonathan Nieder
The former caller uses unable_to_lock_message now. Signed-off-by: Jonathan Nieder Reviewed-by: Ronnie Sahlberg --- cache.h| 1 - lockfile.c | 10 -- 2 files changed, 11 deletions(-) diff --git a/cache.h b/cache.h index 03a6144..995729f 100644 --- a/cache.h +++ b/cache.h @@ -558,7

[PATCH 15/19] refs.c: fix handling of badly named refs

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Wed, 3 Sep 2014 11:45:43 -0700 We currently do not handle badly named refs well: $ cp .git/refs/heads/master .git/refs/heads/master.@\*@\\. $ git branch fatal: Reference has invalid format: 'refs/heads/master.@*@\.' $ git branch -D master.@\*@\\.

[PATCH 17/19] refs.c: do not permit err == NULL

2014-09-10 Thread Jonathan Nieder
Some functions that take a strbuf argument to append an error to treat !err as an indication that the message should be suppressed (e.g., ref_update_reject_duplicates). Others write the message to stderr on !err (e.g., repack_without_refs). Others crash (e.g., ref_transaction_update). Some of th

[PATCH 16/19] for-each-ref.c: improve message before aborting on broken ref

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Fri, 5 Sep 2014 14:35:17 -0700 Print a warning message for any badly named refs we find in the repo. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- builtin/for-each-ref.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/builtin/for-each-

[PATCH 13/19] refs.c: change resolve_ref_unsafe reading argument to be a flags field

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Tue, 15 Jul 2014 12:59:36 -0700 resolve_ref_unsafe takes a boolean argument for reading. Change this to be a flags field instead and pass the new constant RESOLVE_REF_READING when we want this behaviour. Swap two of the arguments in the function to make sure that we c

[PATCH 12/19] refs.c: make write_ref_sha1 static

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Mon, 28 Apr 2014 15:36:58 -0700 No external users call write_ref_sha1 any more so lets declare it static. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 10 -- refs.h | 3 --- 2 files changed, 8 insertions(+), 5 deletions(-) di

[PATCH 11/19] fetch.c: change s_update_ref to use a ref transaction

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Mon, 28 Apr 2014 13:49:07 -0700 Change s_update_ref to use a ref transaction for the ref update. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- builtin/fetch.c | 34 -- 1 file changed, 24 insertions(+), 10 deletion

[PATCH 09/19] refs.c: pass a skip list to name_conflict_fn

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Thu, 1 May 2014 11:16:07 -0700 Allow passing a list of refs to skip checking to name_conflict_fn. There are some conditions where we want to allow a temporary conflict and skip checking those refs. For example if we have a transaction that 1, guarantees that m is a pac

[PATCH 10/19] refs.c: ref_transaction_commit: distinguish name conflicts from other errors

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Fri, 16 May 2014 14:14:38 -0700 In _commit, ENOTDIR can happen in the call to lock_ref_sha1_basic, either when we lstat the new refname and it returns ENOTDIR or if the name checking function reports that the same type of conflict happened. In both cases it means that

[PATCH 08/19] refs.c: call lock_ref_sha1_basic directly from commit

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Thu, 1 May 2014 10:43:39 -0700 Skip using the lock_any_ref_for_update wrapper and call lock_ref_sha1_basic directly from the commit function. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 12 ++-- 1 file changed, 6 insertions(+)

[PATCH 06/19] rename_ref: don't ask read_ref_full where the ref came from

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Wed, 30 Apr 2014 12:41:04 -0700 We call read_ref_full with a pointer to flags from rename_ref but since we never actually use the returned flags we can just pass NULL here instead. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- refs.c | 2 +- 1 f

[PATCH 05/19] refs.c: pass the ref log message to _create/delete/update instead of _commit

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Wed, 30 Apr 2014 12:22:42 -0700 Change the reference transactions so that we pass the reflog message through to the create/delete/update function instead of the commit message. This allows for individual messages for each change in a multi ref transaction. Signed-off-

[PATCH 07/19] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Thu, 1 May 2014 10:40:10 -0700 Move the check for check_refname_format from lock_any_ref_for_update to lock_ref_sha1_basic. At some later stage we will get rid of lock_any_ref_for_update completely. This has no visible impact to callers, except for inability to lock ba

[PATCH 04/19] refs.c: add an err argument to delete_ref_loose

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Thu, 15 May 2014 08:25:23 -0700 Add an err argument to delete_loose_ref so that we can pass a descriptive error string back to the caller. Pass the err argument from transaction commit to this function so that transaction users will have a nice error string if the tran

[PATCH 03/19] wrapper.c: add a new function unlink_or_msg

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Date: Wed, 16 Jul 2014 11:20:36 -0700 This behaves like unlink_or_warn except that on failure it writes the message to its 'err' argument, which the caller can display in an appropriate way or ignore. Signed-off-by: Ronnie Sahlberg Signed-off-by: Jonathan Nieder --- git-

[PATCH 02/19] wrapper.c: remove/unlink_or_warn: simplify, treat ENOENT as success

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg Simplify the function warn_if_unremovable slightly. Additionally, change behaviour slightly. If we failed to remove the object because the object does not exist, we can still return success back to the caller since none of the callers depend on "fail if the file did not exis

[PATCH 01/19] mv test: recreate mod/ directory instead of relying on stale copy

2014-09-10 Thread Jonathan Nieder
The tests for 'git mv moves a submodule' functionality often run commands like git mv sub mod/sub to move a submodule into a subdirectory. Just like plain /bin/mv, this is supposed to succeed if the mod/ parent directory exists and fail if it doesn't exist. Usually these tests mkdir the

[PATCH v21 0/19] rs/ref-transaction (Re: Transaction patch series overview)

2014-09-10 Thread Jonathan Nieder
Jonathan Nieder wrote: > The next series from Ronnie's collection is available at > https://code-review.googlesource.com/#/q/topic:ref-transaction in case > someone wants a fresh series to look at. Here is the outcome of that review. It could use another set of eyes (hint, hint) but should be mo

Re: [PATCH v2] refs: speed up is_refname_available

2014-09-10 Thread Jeff King
On Wed, Sep 10, 2014 at 03:21:39PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > ... > > Reviewed-by: Michael Haggerty > > Signed-off-by: Jeff King > > --- > > Sorry for the quick v2; Michael and I crossed emails off-list, and I > > missed some of his review. This version has some min

Re: [PATCH] git-notes.txt: Explain how to transfer notes between repos

2014-09-10 Thread Johan Herland
On Wed, Sep 10, 2014 at 3:56 PM, Øyvind A. Holm wrote: > The documentation for git notes did not mention anywhere how to transfer > notes between repositories, create a section that explains this topic. Thanks! Although there are some online resource containing similar information (e.g. http://gi

[PATCH v2 31/32] checkout: don't require a work tree when checking out into a new one

2014-09-10 Thread Nguyễn Thái Ngọc Duy
From: Dennis Kaarsemaker For normal use cases, it does not make sense for 'checkout' to work on a bare repository, without a worktree. But "checkout --to" is an exception because it _creates_ a new worktree. Allow this option to run on bare repositories. People who check out from a bare reposito

[PATCH v2 30/32] git_path(): keep "info/sparse-checkout" per work-tree

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Currently git_path("info/sparse-checkout") resolves to $GIT_COMMON_DIR/info/sparse-checkout in multiple worktree mode. It makes more sense for the sparse checkout patterns to be per worktree, so you can have multiple checkouts with different parts of the tree. With this, "git checkout --to " on a

[PATCH v2 32/32] t2025: add a test to make sure grafts is working from a linked checkout

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t2025-checkout-to.sh | 18 ++ 1 file changed, 18 insertions(+) diff --git a/t/t2025-checkout-to.sh b/t/t2025-checkout-to.sh index 2cddbf1..27384a1 100755 --- a/t/t2025-checkout-to.sh +++ b/t/t2025-checkout-to.sh @@ -96,4 +96,22 @@ test_ex

[PATCH v2 27/32] gc: factor out gc.pruneexpire parsing code

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/gc.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index 3bfb990..e38c902 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -55,6 +55,17 @@ static

[PATCH v2 28/32] gc: support prune --worktrees

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/config.txt | 7 +++ Documentation/git-checkout.txt | 2 +- builtin/gc.c | 11 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 28

[PATCH v2 29/32] count-objects: report unused files in $GIT_DIR/worktrees/...

2014-09-10 Thread Nguyễn Thái Ngọc Duy
In linked checkouts, borrowed parts like config is taken from $GIT_COMMON_DIR. $GIT_DIR/config is never used. Report them as garbage. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/count-objects.c | 4 +++- cache.h | 1 + path.c | 29 ++

[PATCH v2 26/32] gc: style change -- no SP before closing parenthesis

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/gc.c b/builtin/gc.c index 8d219d8..3bfb990 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -298,7 +298,7 @@ int cmd_gc(int argc, const ch

[PATCH v2 19/32] setup.c: support multi-checkout repo setup

2014-09-10 Thread Nguyễn Thái Ngọc Duy
The repo setup procedure is updated to detect $GIT_DIR/commondir and set $GIT_COMMON_DIR properly. The core.worktree is ignored when $GIT_COMMON_DIR is set. This is because the config file is shared in multi-checkout setup, but checkout directories _are_ different. Making core.worktree effective i

[PATCH v2 20/32] wrapper.c: wrapper to open a file, fprintf then close

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- cache.h | 2 ++ wrapper.c | 31 +++ 2 files changed, 33 insertions(+) diff --git a/cache.h b/cache.h index e3ff7dc..bf4d15e 100644 --- a/cache.h +++ b/cache.h @@ -1359,6 +1359,8 @@ static inline

[PATCH v2 18/32] setup.c: detect $GIT_COMMON_DIR check_repository_format_gently()

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- setup.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.c b/setup.c index a17389f..79f79f2 100644 --- a/setup.c +++ b/setup.c @@ -346,6 +346,10 @@ static int check_repository_format_gently(const

[PATCH v2 23/32] prune: strategies for linked checkouts

2014-09-10 Thread Nguyễn Thái Ngọc Duy
(alias R=$GIT_COMMON_DIR/worktrees/) - linked checkouts are supposed to keep its location in $R/gitdir up to date. The use case is auto fixup after a manual checkout move. - linked checkouts are supposed to update mtime of $R/gitdir. If $R/gitdir's mtime is older than a limit, and it poin

[PATCH v2 25/32] checkout: clean up half-prepared directories in --to mode

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 48 t/t2025-checkout-to.sh | 6 ++ 2 files changed, 54 insertions(+) diff --git a/builtin/checkout.c b/builtin/checkout.c index 6d623fa..f419ddf 100644 --- a/builtin/checkout.c

[PATCH v2 22/32] checkout: support checking out into a new working directory

2014-09-10 Thread Nguyễn Thái Ngọc Duy
"git checkout --to" sets up a new working directory with a .git file pointing to $GIT_DIR/worktrees/. It then executes "git checkout" again on the new worktree with the same arguments except "--to" is taken out. The second checkout execution, which is not contaminated with any info from the current

[PATCH v2 17/32] setup.c: convert check_repository_format_gently to use strbuf

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- setup.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setup.c b/setup.c index 176d505..a17389f 100644 --- a/setup.c +++ b/setup.c @@ -342,7 +342,9 @@ void setup_work_tree(void) static int

[PATCH v2 24/32] checkout: reject if the branch is already checked out elsewhere

2014-09-10 Thread Nguyễn Thái Ngọc Duy
One branch obviously can't be checked out at two places (but detached heads are ok). Give the user a choice in this case: --detach, -b new-branch, switch branch in the other checkout first or simply 'cd' and continue to work there. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c |

[PATCH v2 16/32] setup.c: detect $GIT_COMMON_DIR in is_git_directory()

2014-09-10 Thread Nguyễn Thái Ngọc Duy
If the file "$GIT_DIR/commondir" exists, it contains the value of $GIT_COMMON_DIR. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- Documentation/gitrepository-layout.txt | 7 ++ setup.c| 43 +- 2 files ch

[PATCH v2 21/32] use new wrapper write_file() for simple file writing

2014-09-10 Thread Nguyễn Thái Ngọc Duy
This fixes common problems in these code about error handling, forgetting to close the file handle after fprintf() fails, or not printing out the error string.. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/branch.c | 4 +--- builtin/init-db.c | 7 +-- dae

[PATCH v2 10/32] commit: use SEQ_DIR instead of hardcoding "sequencer"

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/commit.c b/builtin/commit.c index 461c3b1..4b9f012 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -156,7 +156,7 @@ static vo

[PATCH v2 13/32] *.sh: avoid hardcoding $GIT_DIR/hooks/...

2014-09-10 Thread Nguyễn Thái Ngọc Duy
If $GIT_COMMON_DIR is set, it should be $GIT_COMMON_DIR/hooks/, not $GIT_DIR/hooks/. Just let rev-parse --git-path handle it. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- git-am.sh | 22 +++--- git-rebase--interactive.sh

[PATCH v2 12/32] git-sh-setup.sh: use rev-parse --git-path to get $GIT_DIR/objects

2014-09-10 Thread Nguyễn Thái Ngọc Duy
If $GIT_COMMON_DIR is set, $GIT_OBJECT_DIRECTORY should be $GIT_COMMON_DIR/objects, not $GIT_DIR/objects. Just let rev-parse --git-path handle it. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- git-sh-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

[PATCH v2 09/32] fast-import: use git_path() for accessing .git dir instead of get_git_dir()

2014-09-10 Thread Nguyễn Thái Ngọc Duy
This allows git_path() to redirect info/fast-import to another place if needed Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- fast-import.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fast-import.c b/fast-import.c index d9c068b..ea426c4 100644

[PATCH v2 07/32] *.sh: respect $GIT_INDEX_FILE

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- git-pull.sh | 2 +- git-stash.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/git-pull.sh b/git-pull.sh index 18a394f..6ab0c31 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -240,7 +240,7 @@ test true

[PATCH v2 15/32] setup.c: convert is_git_directory() to use strbuf

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- setup.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/setup.c b/setup.c index 0a22f8b..425fd79 100644 --- a/setup.c +++ b/setup.c @@ -238,31 +238,36 @@ void verify_

[PATCH v2 11/32] $GIT_COMMON_DIR: a new environment variable

2014-09-10 Thread Nguyễn Thái Ngọc Duy
This variable is intended to support multiple working directories attached to a repository. Such a repository may have a main working directory, created by either "git init" or "git clone" and one or more linked working directories. These working directories and the main repository share the same r

[PATCH v2 14/32] git-stash: avoid hardcoding $GIT_DIR/logs/....

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- git-stash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-stash.sh b/git-stash.sh index 393e1ec..41f8f6b 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -184,7 +184,7 @@ store_stash () {

[PATCH v2 06/32] git_path(): be aware of file relocation in $GIT_DIR

2014-09-10 Thread Nguyễn Thái Ngọc Duy
We allow the user to relocate certain paths out of $GIT_DIR via environment variables, e.g. GIT_OBJECT_DIRECTORY, GIT_INDEX_FILE and GIT_GRAFT_FILE. Callers are not supposed to use git_path() or git_pathdup() to get those paths. Instead they must use get_object_directory(), get_index_file() and get

[PATCH v2 08/32] reflog: avoid constructing .lock path with git_path

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Among pathnames in $GIT_DIR, e.g. "index" or "packed-refs", we want to automatically and silently map some of them to the $GIT_DIR of the repository we are borrowing from via $GIT_COMMON_DIR mechanism. When we formulate the pathname for its lockfile, we want it to be in the same location as its fi

[PATCH v2 04/32] path.c: rename vsnpath() to do_git_path()

2014-09-10 Thread Nguyễn Thái Ngọc Duy
The name vsnpath() gives an impression that this is general path handling function. It's not. This is the underlying implementation of git_path(), git_pathdup() and strbuf_git_path() which will prefix $GIT_DIR in the result string. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano

[PATCH v2 05/32] path.c: group git_path(), git_pathdup() and strbuf_git_path() together

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- path.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/path.c b/path.c index 2cb2e61..65881aa 100644 --- a/path.c +++ b/path.c @@ -78,6 +78,16 @@ void strbuf_git_path(struct strbuf *s

[PATCH v2 01/32] path.c: make get_pathname() return strbuf instead of static buffer

2014-09-10 Thread Nguyễn Thái Ngọc Duy
We've been avoiding PATH_MAX whenever possible. This patch makes get_pathname() return a strbuf and updates the callers to take advantage of this. The code is simplified as we no longer need to worry about buffer overflow. vsnpath() behavior is changed slightly: previously it always clears the buf

[PATCH v2 02/32] path.c: make get_pathname() call sites return const char *

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Before the previous commit, get_pathname returns an array of PATH_MAX length. Even if git_path() and similar functions does not use the whole array, git_path() caller can, in theory. After the commit, get_pathname() may return a buffer that has just enough room for the returned string and git_path

[PATCH v2 03/32] git_snpath(): retire and replace with strbuf_git_path()

2014-09-10 Thread Nguyễn Thái Ngọc Duy
In the previous patch, git_snpath() is modified to allocate a new strbuf buffer because vsnpath() needs that. But that makes it awkward because git_snpath() receives a pre-allocated buffer from outside and has to copy data back. Rename it to strbuf_git_path() and make it receive strbuf directly. U

[PATCH v2 00/32] nd/multiple-work-trees

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Changes since last send (diff below): - rename $GIT_DIR/repos to $GIT_DIR/worktrees. update documents and command options accordingly - rewrite the multiple checkout section in git-checkout.txt - reorder some patches to make sure the test suite always pass diff --git a/Documentation/config.

Re: [PATCH v2 2/2] wincred: improve compatibility with windows versions

2014-09-10 Thread Erik Faye-Lund
On Thu, Jan 10, 2013 at 1:10 PM, Karsten Blees wrote: > static int match_cred(const CREDENTIALW *cred) > { > - return (!wusername || !wcscmp(wusername, cred->UserName)) && > - match_attr(cred, L"git_protocol", protocol) && > - match_attr(cred, L"git_host", host) && > -

Re: [PATCH v2] refs: speed up is_refname_available

2014-09-10 Thread Junio C Hamano
Jeff King writes: > ... > Reviewed-by: Michael Haggerty > Signed-off-by: Jeff King > --- > Sorry for the quick v2; Michael and I crossed emails off-list, and I > missed some of his review. This version has some minor style and comment > fixups. Looks sensible from a cursory read, but it confli

Re: [PATCH v2] refs: speed up is_refname_available

2014-09-10 Thread Junio C Hamano
Jeff King writes: > ... > Reviewed-by: Michael Haggerty > Signed-off-by: Jeff King > --- > Sorry for the quick v2; Michael and I crossed emails off-list, and I > missed some of his review. This version has some minor style and comment > fixups. Looks sensible from a cursory read, but it confli

Loan

2014-09-10 Thread Atlas Finance Loan
Do you need a loan or any financial assistance? Kindly get back to us now at: atlasfinanciall...@live.com or 0810604088 for more info -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.o

[PATCH 2/2] pretty: add %D format specifier

2014-09-10 Thread Harry Jeffery
%d prints decorations wrapped by " (" and ")". %D provides the same output without the parenthesis, making " (%D)" and "%d" equivalent to one another. Signed-off-by: Harry Jeffery --- Documentation/pretty-formats.txt | 6 -- pretty.c | 4 2 files changed, 8 inse

[PATCH 1/2] log-tree: make format_decorations more flexible

2014-09-10 Thread Harry Jeffery
The prefix, separator and suffix for decorations are hard-coded. Make format_decorations more flexible by having the caller specify the prefix, separator and suffix. Signed-off-by: Harry Jeffery --- log-tree.c | 16 +--- log-tree.h | 2 +- pretty.c | 2 +- 3 files changed, 11 in

Re: [PATCH v2 6/6] Make sure that index-pack --strict fails upon invalid tag objects

2014-09-10 Thread Junio C Hamano
Johannes Schindelin writes: > +test_expect_success 'index-pack --strict fails upon invalid tag' ' > +sha=$(git rev-parse HEAD) && > +cat >wrong-tag < +object $sha > +type commit > +tag guten tag > + > +This is an invalid tag. > +EOF Missing tagger is merely a warning event (thanks for a

Re: [PATCH v2 0/6] Improve tag checking in fsck and with transfer.fsckobjects

2014-09-10 Thread Junio C Hamano
Junio C Hamano writes: > Johannes Schindelin writes: > >> This patch series introduces detailed checking of tag objects when calling >> git fsck, and also when transfer.fsckobjects is set to true. >> >> To this end, the fsck machinery is reworked to accept the buffer and size >> of the object to

Re: [PATCH 8/9] autoconf: Check for timer_settime

2014-09-10 Thread Keller, Jacob E
On Wed, 2014-09-10 at 14:08 -0700, Junio C Hamano wrote: > Karsten Blees writes: > > > While the timer extension (timer_settime) has graduated to mandatory in > > the current POSIX spec, the monotonic clock extension is still optional > > today (i.e. not necessarily supported even on newer Unices

Re: [PATCH 8/9] autoconf: Check for timer_settime

2014-09-10 Thread Junio C Hamano
Karsten Blees writes: > While the timer extension (timer_settime) has graduated to mandatory in > the current POSIX spec, the monotonic clock extension is still optional > today (i.e. not necessarily supported even on newer Unices). In contrast > to this, the XSI extensions seem to be widely supp

Re: [PATCH v2 0/6] Improve tag checking in fsck and with transfer.fsckobjects

2014-09-10 Thread Junio C Hamano
Johannes Schindelin writes: > This patch series introduces detailed checking of tag objects when calling > git fsck, and also when transfer.fsckobjects is set to true. > > To this end, the fsck machinery is reworked to accept the buffer and size > of the object to check, and for commit and tag ob

Re: Next Git conference or meeting

2014-09-10 Thread Christian Couder
On Wed, Sep 10, 2014 at 10:14 PM, Jeff King wrote: > On Tue, Sep 09, 2014 at 05:49:06PM +0200, Christian Couder wrote: > >> Could you ask if they talked to Linux Foundation folks? > > I've just asked; I'll let you know if I hear. Thanks. > I've seen LF folks mentioned a few times in this thread.

Re: [PATCH v2 3/6] Make sure fsck_commit_buffer() does not run out of the buffer

2014-09-10 Thread Eric Sunshine
On Wed, Sep 10, 2014 at 9:52 AM, Johannes Schindelin wrote: > So far, we assumed that the buffer is NUL terminated, but this is not > a safe assumption, now that we opened the fsck_object() API to pass a > buffer directly. > > So let's make sure that there is at least an empty line in the buffer.

Re: Next Git conference or meeting

2014-09-10 Thread Jeff King
On Tue, Sep 09, 2014 at 05:49:06PM +0200, Christian Couder wrote: > > Christian mentioned that he talked to some GitHub folks at LinuxCon. > > Those folks have also started thinking about things. :) > > > > Things are still very tentative at this point, but I think they are > > considering somethi

Re: [PATCH] git-notes.txt: Explain how to transfer notes between repos

2014-09-10 Thread Eric Sunshine
On Wed, Sep 10, 2014 at 9:56 AM, Øyvind A. Holm wrote: > The documentation for git notes did not mention anywhere how to transfer > notes between repositories, create a section that explains this topic. > > Signed-off-by: Øyvind A. Holm > --- > diff --git a/Documentation/git-notes.txt b/Documenta

Re: [PATCH] refs: write packed_refs file using stdio

2014-09-10 Thread Jeff King
On Wed, Sep 10, 2014 at 07:32:17AM -0700, Ronnie Sahlberg wrote: > Even better could be to build an iovec for all the data and use writev() ? > (now without gmail adding formatting) I'm not sure that would make anything easier. We're literally sprintf-ing (and calling sha1_to_hex) into a buffer s

Re: [PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-10 Thread Jeff King
On Wed, Sep 10, 2014 at 09:51:03AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > Yes, we don't let normal fetchers see these repos. They're only for > > holding shared objects and the ref tips to keep them reachable. > > Are these individual refs have relations to the real world after

Re: [PATCH v2 5/6] Add regression tests for stricter tag fsck'ing

2014-09-10 Thread Junio C Hamano
Johannes Schindelin writes: > + test_when_finished "git update-ref -d refs/tags/wrong" && > + git fsck --tags 2>out && I wonder what the command does with or without --tags option (applies to both tests added by this patch)? Does running "fsck" without the option not to report broken ta

Re: [PATCH v2 4/6] fsck: check tag objects' headers

2014-09-10 Thread Junio C Hamano
Johannes Schindelin writes: > + if (!skip_prefix(buffer, "tag ", &buffer)) { > + ret = error_func(&tag->object, FSCK_ERROR, "invalid format - > expected 'tag' line"); > + goto done; > + } > + eol = strchr(buffer, '\n'); > + if (!eol) { > + ret

Re: [PATCH v2 3/6] Make sure fsck_commit_buffer() does not run out of the buffer

2014-09-10 Thread Junio C Hamano
Johannes Schindelin writes: > So far, we assumed that the buffer is NUL terminated, but this is not > a safe assumption, now that we opened the fsck_object() API to pass a > buffer directly. > > So let's make sure that there is at least an empty line in the buffer. > That way, our checks would fa

Re: [RFC PATCH v2 1/2] Makefile: add check-headers target

2014-09-10 Thread Matthieu Moy
Junio C Hamano writes: > David Aguilar writes: > >> On Mon, Sep 08, 2014 at 12:57:46PM -0700, Junio C Hamano wrote: >>> Matthieu Moy writes: >>> ... >>> > for header in .h ewah/*.h vcs-svn/*.h xdiff/*.h >>> > do >>> > ... >>> > done >>> >>> Yes, that would be even better. Then you wouldn't

Re: [PATCH] pretty-format: add append line-feed format specifier

2014-09-10 Thread Junio C Hamano
Jeff King writes: > Something like the patch below might work, but I didn't test it very > thoroughly (and note the comments, which might need dealing with). Maybe > it would make a sensible base for Harry to build on if he wants to > pursue this. > > With it, you can do: > > git log --format='

Re: [PATCH/RFC 0/2] custom format for interactive rebase todo

2014-09-10 Thread Junio C Hamano
William Clifford writes: > I will see about actually reading > in additional lines and raising an error, but it occurs to me that if > I can read in the additional lines, I could also insert them as > comments, and then it should be as safe as any of the other comments > inserted in the rebase to

Re: [RFC PATCH v2 1/2] Makefile: add check-headers target

2014-09-10 Thread Junio C Hamano
David Aguilar writes: > On Mon, Sep 08, 2014 at 12:57:46PM -0700, Junio C Hamano wrote: >> Matthieu Moy writes: >> ... >> > for header in .h ewah/*.h vcs-svn/*.h xdiff/*.h >> > do >> >... >> > done >> >> Yes, that would be even better. Then you wouldn't even have to >> worry about $IFS dan

Re: [PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-10 Thread Junio C Hamano
Jeff King writes: > Yes, we don't let normal fetchers see these repos. They're only for > holding shared objects and the ref tips to keep them reachable. Are these individual refs have relations to the real world after they are created? To ask it another way, let's say that a branch in a reposi

Re: What's cooking in git.git (Sep 2014, #02; Tue, 9)

2014-09-10 Thread Junio C Hamano
Jeff King writes: > On Tue, Sep 09, 2014 at 02:26:22PM -0700, Junio C Hamano wrote: > >> * jk/command-line-config-empty-string (2014-08-05) 1 commit >> (merged to 'next' on 2014-08-29 at 74f04af) >> + config: teach "git -c" to recognize an empty string >> >> "git -c section.var command" and

Re: [PATCH 8/9] autoconf: Check for timer_settime

2014-09-10 Thread Karsten Blees
Am 29.08.2014 19:40, schrieb Keller, Jacob E: > On Fri, 2014-08-29 at 19:26 +0200, Johannes Sixt wrote: >> Am 29.08.2014 18:42, schrieb Jacob Keller: >>> From: Jonas 'Sortie' Termansen >>> >>> This function will be used in a following commit. >>> >>> The timer_settime function is provided in librt

Re: git-remote-fd problem

2014-09-10 Thread Ilari Liusvaara
On Wed, Sep 10, 2014 at 03:29:00PM +0200, Jiri Sevcik wrote: > Hi! > I have problem with using git-remote-fd function. I create two local > pipes for communication for locally running process git pull. Then I > start git-upload-pack on remote side (this process is started in > different part of my

Re: [PATCH/RFC 0/2] custom format for interactive rebase todo

2014-09-10 Thread William Clifford
Thanks! I've set it up just this way and it seems to work fine. It turns out the formatted string is processed by the shell `read` later on, which happens to ignore everything after the first line, so it seems like it should be safe. But doing something explicit about it seems like a good idea in

[PATCH] git-notes.txt: Explain how to transfer notes between repos

2014-09-10 Thread Øyvind A . Holm
The documentation for git notes did not mention anywhere how to transfer notes between repositories, create a section that explains this topic. Signed-off-by: Øyvind A. Holm --- Documentation/git-notes.txt | 39 +++ 1 file changed, 39 insertions(+) diff --git

Re: [PATCH v2 0/6] Improve tag checking in fsck and with transfer.fsckobjects

2014-09-10 Thread Johannes Schindelin
Hi Junio, On Wed, 10 Sep 2014, Johannes Schindelin wrote: > Still unaddressed: > > - getting rid of struct object altogether in fsck (I felt this was quite a big > task, getting much more familiar with the non-tag code paths, and I did not > want to delay this patch series up any further) >

[PATCH v2 6/6] Make sure that index-pack --strict fails upon invalid tag objects

2014-09-10 Thread Johannes Schindelin
One of the most important use cases for the strict tag object checking is when transfer.fsckobjects is set to true to catch invalid objects early on. This new regression test essentially tests the same code path by directly calling 'index-pack --strict' on a pack containing an invalid tag object.

[PATCH v2 5/6] Add regression tests for stricter tag fsck'ing

2014-09-10 Thread Johannes Schindelin
The intent of the two new test cases is to catch general breakages in the fsck_tag() function, not so much to test it extensively, trying to strike the proper balance between thoroughness and speed. Signed-off-by: Johannes Schindelin --- t/t1450-fsck.sh | 39 +

[PATCH v2 4/6] fsck: check tag objects' headers

2014-09-10 Thread Johannes Schindelin
We inspect commit objects pretty much in detail in git-fsck, but we just glanced over the tag objects. Let's be stricter. Since we do not want to limit 'tag' lines unduly, values that would fail the refname check only result in warnings, not errors. Signed-off-by: Johannes Schindelin --- fsck.c

[PATCH v2 3/6] Make sure fsck_commit_buffer() does not run out of the buffer

2014-09-10 Thread Johannes Schindelin
So far, we assumed that the buffer is NUL terminated, but this is not a safe assumption, now that we opened the fsck_object() API to pass a buffer directly. So let's make sure that there is at least an empty line in the buffer. That way, our checks would fail if the empty line was encountered prem

[PATCH v2 0/6] Improve tag checking in fsck and with transfer.fsckobjects

2014-09-10 Thread Johannes Schindelin
This patch series introduces detailed checking of tag objects when calling git fsck, and also when transfer.fsckobjects is set to true. To this end, the fsck machinery is reworked to accept the buffer and size of the object to check, and for commit and tag objects, we verify that the buffers conta

[PATCH v2 1/6] Refactor type_from_string() to avoid die()ing in case of errors

2014-09-10 Thread Johannes Schindelin
In the next commits, we will enhance the fsck_tag() function to check tag objects more thoroughly. To this end, we need a function to verify that a given string is a valid object type, but that does not die() in the negative case. While at it, prepare type_from_string() for counted strings, i.e. s

[PATCH v2 2/6] Accept object data in the fsck_object() function

2014-09-10 Thread Johannes Schindelin
When fsck'ing an incoming pack, we need to fsck objects that cannot be read via read_sha1_file() because they are not local yet (and might even be rejected if transfer.fsckobjects is set to 'true'). For commits, there is a hack in place: we basically cache commit objects' buffers anyway, but the s

Re: git 2.1.0: make fails

2014-09-10 Thread Gerry Reno
On 09/09/2014 06:42 PM, Jeff King wrote: > On Tue, Sep 09, 2014 at 04:34:02PM -0400, Gerry Reno wrote: > >> Downloaded the git-2.1.0.tar.gz tarball. >> >> Cannot build git 2.1.0: > Weird. It works fine for me on Debian unstable. What platform are you on? > >> cc -g -O2 -Wall -I. -DHAVE_ALLOCA

git-remote-fd problem

2014-09-10 Thread Jiri Sevcik
Hi! I have problem with using git-remote-fd function. I create two local pipes for communication for locally running process git pull. Then I start git-upload-pack on remote side (this process is started in different part of my code and it works correctly). Communication runs successfully and when

Re: [PATCH v4 19/32] commit_lock_file(): rollback lock file on failure to rename

2014-09-10 Thread Duy Nguyen
On Wed, Sep 10, 2014 at 2:55 PM, Jeff King wrote: > BTW, while grepping for commit_lock_file calls, I notice we often commit > the shallow file without checking the return code. I'm not sure what we > should do in each case, but I imagine that calling die() is probably > better than continuing as

  1   2   >