[PATCH] worktree: refactor lock_reason_valid and lock_reason to be more sensible

2018-10-24 Thread nbelakovski
From: Nickolai Belakovski lock_reason_valid is renamed to is_locked and lock_reason is removed as a field of the worktree struct. Lock reason can be obtained instead by a standalone function. This is done in order to make the worktree struct more intuitive when it is used elsewhere in the

[PATCH v3 1/2] worktree: update documentation for lock_reason and lock_reason_valid

2018-10-30 Thread nbelakovski
From: Nickolai Belakovski Clarify that these fields are to be considered implementation details and direct the reader to use the is_worktree_locked function to retrieve said information. Signed-off-by: Nickolai Belakovski --- worktree.h | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v3 2/2] worktree: rename is_worktree_locked to worktree_lock_reason

2018-10-30 Thread nbelakovski
From: Nickolai Belakovski A function prefixed with 'is_' would be expected to return a boolean, however this function returns a string. Signed-off-by: Nickolai Belakovski --- builtin/worktree.c | 10 +- worktree.c | 2 +- worktree.h | 4 ++-- 3 files changed, 8

[PATCH] worktree: populate lock_reason in get_worktrees and light refactor/cleanup in worktree files

2018-10-24 Thread nbelakovski
. The lock_reason_valid field was removed since a NULL/non-NULL value of lock_reason accomplishes the same effect. Some unused variables within worktree source code were removed. Signed-off-by: Nickolai Belakovski --- Notes: Travis CI results: https://travis-ci.org/nbelakovski/git/builds/445500127 builtin

[PATCH v2 2/2] branch: Mark and colorize a branch differently if it is checked out in a linked worktree

2018-11-11 Thread nbelakovski
From: Nickolai Belakovski In order to more clearly display which branches are active, the output of git branch is modified to mark branches checkout out in a linked worktree with a "+" and color them in a faint light green (in contrast to the current branch, which will still be denoted with a

[PATCH v2 1/2] ref-filter: add worktree atom

2018-11-11 Thread nbelakovski
From: Nickolai Belakovski Add an atom expressing whether the particular ref is checked out in a linked worktree. Signed-off-by: Nickolai Belakovski --- ref-filter.c | 31 +++ t/t6302-for-each-ref-filter.sh | 15 +++ 2 files changed, 46

[PATCH v2 0/2] refactoring branch colorization to ref-filter

2018-11-11 Thread nbelakovski
of the changes introduced here. I've split this work into two commits since the items are logically separate. CI results: https://travis-ci.org/nbelakovski/git/builds/453723727 Nickolai Belakovski (2): ref-filter: add worktree atom branch: Mark and colorize a branch differently if it is checked out