[PATCH] setup: Fix windows path buffer over-stepping

2014-04-24 Thread Martin Erik Werner
simply avoiding to increment by offset_1st_component() and wtlen at the same time. Signed-off-by: Martin Erik Werner --- This is a follow-up on 655ee9e mw/symlinks which is currently merged into master, prospective for git v2.0.0, the issue only affects v2.0.0-rc0. setup.c | 4 ++-- 1 file chang

Re: [ANNOUNCE] Git v2.0.0-rc4

2014-05-21 Thread Martin Erik Werner
) In order to include the latest cleanup to this patchset: "setup: fix windows path buffer over-stepping" this should be 6127ff6 instead. Sorry if it's unneeded to note, but just wanted to make sure :) -- Martin Erik Werner -- To unsubscribe from this list: send the line "unsubs

git-mv with absolute path derefereces symlinks

2014-01-15 Thread Martin Erik Werner
renamed:target -> moved $ git mv "$(pwd)/link2" "$(pwd)/moved2" fatal: /home/arand/tmp/linktest/link2: '/home/arand/tmp/linktest/link2' is outside repository ### -- Martin Erik Werner -- To unsubscribe from this list: send the line "unsubscribe git"

[PATCH 0/2] in-tree symlink handling with absolute paths

2014-01-26 Thread Martin Erik Werner
On Wed, 2014-01-15 at 13:48 +0100, Martin Erik Werner wrote: > If git-mv is provided absolute paths when moving symlinks, it tries to > dereference them and (attempts to) move the symlink target rather than the > symlink itself, this seems like a quite odd behaviour since it's incon

[PATCH 2/2] setup: Don't dereference in-tree symlinks for absolute paths

2014-01-26 Thread Martin Erik Werner
, nor does now do, any actual prefixing, hence we simply remove the path corresponding to the work tree and return the remaining in-tree part of the path. Fixes t0060-82. Signed-off-by: Martin Erik Werner --- setup.c | 54 --- t/

[PATCH 1/2] t0060: Add test for manipulating symlinks via absolute paths

2014-01-26 Thread Martin Erik Werner
tree into consideration). Add a known-breakage tests using the prefix_path function, which currently uses real_path, causing the dereference. Signed-off-by: Martin Erik Werner --- t/t0060-path-utils.sh | 7 +++ 1 file changed, 7 insertions(+) diff --git a/t/t0060-path-utils.sh b/t/t0060

Re: [PATCH 2/2] setup: Don't dereference in-tree symlinks for absolute paths

2014-01-26 Thread Martin Erik Werner
On Sun, Jan 26, 2014 at 06:19:25PM +0100, Torsten Bögershausen wrote: > On 2014-01-26 15.22, Martin Erik Werner wrote: > > The prefix_path_gently() function currently applies real_path to > > everything if given an absolute path, dereferencing symlinks both > > outside and ins

[PATCH v2 2/2] setup: Don't dereference in-tree symlinks for absolute paths

2014-01-26 Thread Martin Erik Werner
, nor does now do, any actual prefixing, hence we simply remove the path corresponding to the work tree and return the remaining in-tree part of the path. Fixes t0060-82. Signed-off-by: Martin Erik Werner --- setup.c | 64 +++ t/

[PATCH v3 3/4] setup: Add 'abspath_part_inside_repo' function

2014-01-31 Thread Martin Erik Werner
parately, since then there is no directory separator between the work tree and in-repo part. Signed-off-by: Martin Erik Werner --- cache.h | 1 + setup.c | 63 +++ 2 files changed, 64 insertions(+) diff --git a/cache.h b/cache.h index ce3

[PATCH v3 1/4] t0060: Add test for manipulating symlinks via absolute paths

2014-01-31 Thread Martin Erik Werner
tree into consideration). Add a known-breakage tests using the prefix_path function, which currently uses real_path, causing the dereference. Signed-off-by: Martin Erik Werner --- t/t0060-path-utils.sh | 5 + 1 file changed, 5 insertions(+) diff --git a/t/t0060-path-utils.sh b/t/t0060-path

[PATCH v3 4/4] setup: Don't dereference in-tree symlinks for absolute paths

2014-01-31 Thread Martin Erik Werner
lute paths, 'prefix_path_gently' did not, nor does now do, any actual prefixing, hence the result from 'abspath_part_in_repo' is returned as-is. Fixes t0060-82. Signed-off-by: Martin Erik Werner --- setup.c | 36 t/t0060-

[PATCH v3 2/4] t0060: Add test for prefix_path when path == work tree

2014-01-31 Thread Martin Erik Werner
The current behaviour of prefix_path is to return an empty string if prefixing and absolute path that only contains exactly the work tree. This behaviour is a potential regression point. Signed-off-by: Martin Erik Werner --- t/t0060-path-utils.sh | 6 ++ 1 file changed, 6 insertions

[PATCH v3 0/4] setup: Don't dereference in-tree symlinks for absolute paths

2014-01-31 Thread Martin Erik Werner
On Mon, Jan 27, 2014 at 08:31:37AM -0800, Junio C Hamano wrote: > Martin Erik Werner writes: > > > In order to manipulate symliks in the > > work tree using absolute paths, symlinks should only be dereferenced > > outside the work tree. > > I agree 100% with th

Re: [PATCH v3 3/4] setup: Add 'abspath_part_inside_repo' function

2014-01-31 Thread Martin Erik Werner
On Fri, Jan 31, 2014 at 11:37:29PM +0100, Torsten Bögershausen wrote: > On 2014-01-31 21.22, Martin Erik Werner wrote: > > In order to extract the part of an absolute path which lies inside the > > repo, it is not possible to directly use real_path, since that would > > dere

[PATCH v4 0/4] Handling of in-tree symlinks for absolute paths

2014-02-01 Thread Martin Erik Werner
Hmm, maybe fourth time's the ch...nevermind. On Sat, Feb 01, 2014 at 02:31:21AM +0100, Martin Erik Werner wrote: > On Fri, Jan 31, 2014 at 11:37:29PM +0100, Torsten Bögershausen wrote: > > On 2014-01-31 21.22, Martin Erik Werner wrote: (...) > > > diff --git a/cache.

[PATCH v4 1/4] t0060: Add test for manipulating symlinks via absolute paths

2014-02-01 Thread Martin Erik Werner
tree into consideration). Add a known-breakage tests using the prefix_path function, which currently uses real_path, causing the dereference. Signed-off-by: Martin Erik Werner --- t/t0060-path-utils.sh | 5 + 1 file changed, 5 insertions(+) diff --git a/t/t0060-path-utils.sh b/t/t0060-path

[PATCH v4 2/4] t0060: Add test for prefix_path when path == work tree

2014-02-01 Thread Martin Erik Werner
The current behaviour of prefix_path is to return an empty string if prefixing and absolute path that only contains exactly the work tree. This behaviour is a potential regression point. Signed-off-by: Martin Erik Werner --- t/t0060-path-utils.sh | 6 ++ 1 file changed, 6 insertions

[PATCH v4 3/4] setup: Add 'abspath_part_inside_repo' function

2014-02-01 Thread Martin Erik Werner
ual to the work tree is handled separately, since then there is no directory separator between the work tree and in-repo part. This function is currently only intended for use in 'prefix_path_gently'. Signed-off-by: Martin Erik Werner --- setup.c | 57 ++

[PATCH v4 4/4] setup: Don't dereference in-tree symlinks for absolute paths

2014-02-01 Thread Martin Erik Werner
lute paths, 'prefix_path_gently' did not, nor does now do, any actual prefixing, hence the result from 'abspath_part_in_repo' is returned as-is. Fixes t0060-82. Signed-off-by: Martin Erik Werner --- setup.c | 36 1 file changed, 16 insertio

Re: [PATCH v4 3/4] setup: Add 'abspath_part_inside_repo' function

2014-02-02 Thread Martin Erik Werner
On Sun, Feb 02, 2014 at 09:19:04AM +0700, Duy Nguyen wrote: > On Sun, Feb 2, 2014 at 8:59 AM, Martin Erik Werner > wrote: > > + /* check if work tree is already the prefix */ > > + if (strncmp(path, work_tree, wtlen) == 0) { > > +

Re: [PATCH v4 3/4] setup: Add 'abspath_part_inside_repo' function

2014-02-02 Thread Martin Erik Werner
On Sun, Feb 02, 2014 at 12:37:16PM +0100, Torsten Bögershausen wrote: > On 2014-02-02 12.21, David Kastrup wrote: > > Martin Erik Werner writes: > > > >> On Sun, Feb 02, 2014 at 09:19:04AM +0700, Duy Nguyen wrote: > >>> On Sun, Feb 2, 2014 at 8:59

[PATCH v5 0/5] Handling of in-tree symlinks for absolute paths

2014-02-02 Thread Martin Erik Werner
ork tree length, so as minimize the 'real_path' calls. Martin Erik Werner (5): t0060: Add test for manipulating symlinks via absolute paths t0060: Add test for prefix_path when path == work tree t0060: Add tests for prefix_path when path begins with work tree

[PATCH v5 4/5] setup: Add 'abspath_part_inside_repo' function

2014-02-02 Thread Martin Erik Werner
ual to the work tree is handled separately, since then there is no directory separator between the work tree and in-repo part. This function is currently only intended for use in 'prefix_path_gently'. Signed-off-by: Martin

[PATCH v5 2/5] t0060: Add test for prefix_path when path == work tree

2014-02-02 Thread Martin Erik Werner
The current behaviour of prefix_path is to return an empty string if prefixing and absolute path that only contains exactly the work tree. This behaviour is a potential regression point. Signed-off-by: Martin Erik Werner --- t/t0060-path-utils.sh | 6 ++ 1 file changed, 6 insertions

[PATCH v5 1/5] t0060: Add test for manipulating symlinks via absolute paths

2014-02-02 Thread Martin Erik Werner
tree into consideration). Add a known-breakage tests using the prefix_path function, which currently uses real_path, causing the dereference. Signed-off-by: Martin Erik Werner --- t/t0060-path-utils.sh | 5 + 1 file changed, 5 insertions(+) diff --git a/t/t0060-path-utils.sh b/t/t0060-path

[PATCH v5 5/5] setup: Don't dereference in-tree symlinks for absolute paths

2014-02-02 Thread Martin Erik Werner
lute paths, 'prefix_path_gently' did not, nor does now do, any actual prefixing, hence the result from 'abspath_part_in_repo' is returned as-is. Fixes t0060-82. Signed-off-by: Martin Erik Werner --- setup.c | 36 t/t0060-

[PATCH v5 3/5] t0060: Add tests for prefix_path when path begins with work tree

2014-02-02 Thread Martin Erik Werner
One edge-case that isn't currently checked in the tests is the beginning of the path matching the work tree, despite the target not actually being the work tree, for example: path = /dir/repoa work_tree = /dir/repo should fail since the path is outside the repo. However, if /dir/repoa is in f

Re: [PATCH v5 5/5] setup: Don't dereference in-tree symlinks for absolute paths

2014-02-03 Thread Martin Erik Werner
On Mon, Feb 03, 2014 at 11:15:57AM +0700, Duy Nguyen wrote: > On Sun, Feb 2, 2014 at 11:35 PM, Martin Erik Werner > wrote: > > diff --git a/setup.c b/setup.c > > index a2e60ab..230505c 100644 > > --- a/setup.c > > +++ b/setup.c > > @@ -86,11 +86,23 @@ char *p

Re: [PATCH v5 1/5] t0060: Add test for manipulating symlinks via absolute paths

2014-02-03 Thread Martin Erik Werner
On Mon, Feb 03, 2014 at 10:50:17AM -0800, Junio C Hamano wrote: > Martin Erik Werner writes: > > > When symlinks in the working tree are manipulated using the absolute > > path, git dereferences them, and tries to manipulate the link target > > instead. > > The abo

Re: [PATCH v5 4/5] setup: Add 'abspath_part_inside_repo' function

2014-02-03 Thread Martin Erik Werner
; +' > + > test_done Your test looks preferrable to the simple git-add one that I proposed, since it covers some more ground than the simple: test_expect_success SYMLINKS 'add with abs path to link...' ' ln -s target link && git add link ' Will

[PATCH v6 5/6] setup: Add 'abspath_part_inside_repo' function

2014-02-04 Thread Martin Erik Werner
on is currently only intended for use in 'prefix_path_gently'. Signed-off-by: Martin Erik Werner Reviewed-by: Duy Nguyen --- setup.c | 64 1 file changed, 64 insertions(+) diff --git a/setup.c b/setup.c index 5432a31

[PATCH v6 6/6] setup: Don't dereference in-tree symlinks for absolute paths

2014-02-04 Thread Martin Erik Werner
, 'prefix_path_gently' did not, nor does now do, any actual prefixing, hence the result from 'abspath_part_in_repo' is returned as-is. Fixes t0060-82 and t3004-5. Signed-off-by: Martin Erik Werner Reviewed-by: Duy Nguyen --- setup.c | 30 ++---

[PATCH v6 0/6] Handling of in-tree symlinks for absolute paths

2014-02-04 Thread Martin Erik Werner
h '/'-terminated level */ while (*path) { path++; if (*path == '/') { Junio C Hamano (1): t3004: Add test for ls-files on symlinks via absolute paths Martin Erik Werner (5): t0060: Add test for prefix_path on symlinks via absolute paths t0060: Ad

[PATCH v6 1/6] t3004: Add test for ls-files on symlinks via absolute paths

2014-02-04 Thread Martin Erik Werner
tree into consideration). Add a known-breakage test using the ls-files function, checking both if the symlink leads to a target in the same directory, and a target in the above directory. Signed-off-by: Martin Erik Werner Tested-by: Martin Erik Werner --- t/t3004-ls-files-basic.sh | 17

[PATCH v6 3/6] t0060: Add test for prefix_path when path == work tree

2014-02-04 Thread Martin Erik Werner
The current behaviour of prefix_path is to return an empty string if prefixing and absolute path that only contains exactly the work tree. This behaviour is a potential regression point. Signed-off-by: Martin Erik Werner Reviewed-by: Duy Nguyen --- t/t0060-path-utils.sh | 6 ++ 1 file

[PATCH v6 4/6] t0060: Add tests for prefix_path when path begins with work tree

2014-02-04 Thread Martin Erik Werner
is in fact a symlink that points to /dir/repo, it should instead succeed. Add two tests covering these cases, since they might be potential regression points. Signed-off-by: Martin Erik Werner Reviewed-by: Duy Nguyen --- t/t0060-path-utils.sh | 10 ++ 1 file changed, 10 insertions(+)

[PATCH v6 2/6] t0060: Add test for prefix_path on symlinks via absolute paths

2014-02-04 Thread Martin Erik Werner
function, which currently uses real_path, causing the dereference. Signed-off-by: Martin Erik Werner Reviewed-by: Duy Nguyen --- t/t0060-path-utils.sh | 5 + 1 file changed, 5 insertions(+) diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh index 07c10c8..0bba988 100755 --- a/t

Re: [PATCH v5 4/5] setup: Add 'abspath_part_inside_repo' function

2014-02-04 Thread Martin Erik Werner
On Tue, 2014-02-04 at 10:09 -0800, Junio C Hamano wrote: > Martin Erik Werner writes: (...) > > I was trying to convey that if path is simply "/dir/repo", then the while > > loop method of replacing a '/' and checking from the beginning won't >

[BUG] t9151: Unreliable test/test setup

2014-02-05 Thread Martin Erik Werner
5b6a1add9db4c1 (refs/remotes/trunk) Checked out HEAD: file:///home/arand/utv/git/git/t/trash%20directory.t9151-svn-mergeinfo/svnrepo/trunk r44 ok 1 - load svn dump Does anyone who is more familiar with the test know what's going on here? Is there any way to fix it, or should the tes

Bug in filter-branch -d option, new files are dumped into parent

2013-04-02 Thread Martin Erik Werner
2/2) # Ref 'refs/heads/rewrite' was rewritten # error: Untracked working tree file 'baz' would be overwritten by merge. # # At this point, 'baz' is instead staged-deleted in the working directory ### -- Martin Erik Werner -- To unsubscribe from this list: send the line &

[PATCH 0/2] Add bash.showUntrackedFiles config option

2013-02-12 Thread Martin Erik Werner
ar to what exists for bash.showDirtyState. Martin Erik Werner (2): bash completion: add bash.showUntrackedFiles option t9903: add test case for bash.showUntrackedFiles contrib/completion/git-prompt.sh | 11 --- t/t9903-bash-prompt.sh | 11 +++ 2 files change

[PATCH 2/2] t9903: add test case for bash.showUntrackedFiles

2013-02-12 Thread Martin Erik Werner
Add a test case for the bash.showUntrackedFiles config option, which checks that the config option can disable the global effect of the GIT_PS1_SHOWUNTRACKEDFILES environmant variable. Signed-off-by: Martin Erik Werner --- t/t9903-bash-prompt.sh | 11 +++ 1 file changed, 11 insertions

[PATCH 1/2] bash completion: add bash.showUntrackedFiles option

2013-02-12 Thread Martin Erik Werner
Add a config option 'bash.showUntrackedFiles' which allows enabling the prompt showing untracked files on a per-repository basis. This is useful for some repositories where the 'git ls-files ...' command may take a long time. Signed-off-by: Martin Erik Werner --- co

[PATCH v2 0/3] Add bash.showUntrackedFiles config option

2013-02-13 Thread Martin Erik Werner
On Tue, 2013-02-12 at 14:29 -0800, Junio C Hamano wrote: > Martin Erik Werner writes: > > > Add a test case for the bash.showUntrackedFiles config option, which > > checks that the config option can disable the global effect of the > > GIT_PS1_SHOWUNTRACKEDFI

[PATCH v2 1/3] shell prompt: add bash.showUntrackedFiles option

2013-02-13 Thread Martin Erik Werner
Add a config option 'bash.showUntrackedFiles' which allows enabling the prompt showing untracked files on a per-repository basis. This is useful for some repositories where the 'git ls-files ...' command may take a long time. Signed-off-by: Martin Erik Werner --- co

[PATCH v2 2/3] t9903: add tests for bash.showUntrackedFiles

2013-02-13 Thread Martin Erik Werner
Add 4 test for the bash.showUntrackedFiles config option, covering all combinations of the shell var being set/unset and the config option being enabled/disabled. Signed-off-by: Martin Erik Werner --- t/t9903-bash-prompt.sh | 40 1 file changed, 40

[PATCH v2 3/3] t9903: add extra tests for bash.showDirtyState

2013-02-13 Thread Martin Erik Werner
Added 3 extra tests for the bash.showDirtyState config option, tests should now cover all combinations of the shell var being set/unset and the config option being enabled/disabled, given a dirty file. * Renamed test 'disabled by config' to 'shell variable set with config disabled' for consisten

Re: [PATCH v2 2/3] t9903: add tests for bash.showUntrackedFiles

2013-02-13 Thread Martin Erik Werner
On Wed, 2013-02-13 at 08:23 -0800, Junio C Hamano wrote: > Martin Erik Werner writes: > > > Add 4 test for the bash.showUntrackedFiles config option, covering all > > combinations of the shell var being set/unset and the config option > > being enabled/disabled. >

Re: [PATCH v2 3/3] t9903: add extra tests for bash.showDirtyState

2013-02-13 Thread Martin Erik Werner
On Wed, 2013-02-13 at 08:28 -0800, Junio C Hamano wrote: > Martin Erik Werner writes: > > > Added 3 extra tests for the bash.showDirtyState config option, tests > > should now cover all combinations of the shell var being set/unset and > > the config option being enabled

Re: [PATCH v2 3/3] t9903: add extra tests for bash.showDirtyState

2013-02-13 Thread Martin Erik Werner
On Wed, 2013-02-13 at 11:53 -0800, Junio C Hamano wrote: > Martin Erik Werner writes: > > >> Strictly speaking, you have 6 not 4 combinations (shell variable > >> set/unset * config missing/set to false/set to true). I think these > >> additional tests cover sho

[PATCH v3 2/3] t9903: add tests for bash.showUntrackedFiles

2013-02-13 Thread Martin Erik Werner
Add 4 test for the bash.showUntrackedFiles config option, the tests now cover all combinations of the shell var being set/unset and the config option being missing/enabled/disabled. Signed-off-by: Martin Erik Werner --- t/t9903-bash-prompt.sh | 40 1

[PATCH v3 3/3] t9903: add extra tests for bash.showDirtyState

2013-02-13 Thread Martin Erik Werner
disabled' for consistency Signed-off-by: Martin Erik Werner --- t/t9903-bash-prompt.sh | 38 +- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh index dd9ac6a..2101d91 100755 --- a/t/t9903-bash-pro

[PATCH] shell-prompt: clean up nested if-then

2013-02-18 Thread Martin Erik Werner
Minor clean up of if-then nesting in checks for environment variables and config options. No functional changes. --- contrib/completion/git-prompt.sh | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/contrib/completion/git-prompt.sh b/contrib/compl

Re: [PATCH] shell-prompt: clean up nested if-then

2013-02-18 Thread Martin Erik Werner
7;s anyways. I've changed to using [] && [] and rerolled the patch. > Jonathan Nieder wrote: > Hi Martin, > > Martin Erik Werner wrote: > > Minor clean up of if-then nesting in checks for environment > variable