[Bug] git gc with alternates tries accessing non-existing directory

2015-03-18 Thread Ephrim Khong
I have a non-bare repository /home/a set up with an alternate to the bare repository /b. Running git gc on /home/a produces below's error error: unable to open /b/objects/56/b969ffdf64343777a069260f41761dc0551bfa/00: Not a directory The referenced file

Re: [PATCH 0/3] nd/multiple-work-trees updates

2015-03-18 Thread Ephrim Khong
Without having looked into this and nd/multiple-work-trees, but with make multiple checkouts aware of each other in mind: Could this mechanism be re-used to make alternates aware of each other, to mitigate the dangers of having git gc on an alternate remove objects that are used by a

Re: [Bug] git gc with alternates tries accessing non-existing directory

2015-03-18 Thread Ephrim Khong
On 18.03.2015 10:42, Jeff King wrote: On Wed, Mar 18, 2015 at 09:11:48AM +0100, Ephrim Khong wrote: I have a non-bare repository /home/a set up with an alternate to the bare repository /b. Running git gc on /home/a produces below's error [...] git --version git version 2.3.0 Try v2.3.2

Re: [PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-16 Thread Ephrim Khong
On 15.07.2014 21:26, Junio C Hamano wrote: + strbuf_addstr(objdirbuf, absolute_path(get_object_directory())); + normalize_path_copy(objdirbuf.buf, objdirbuf.buf); This is somewhat a strange usage of a strbuf. There might be a more elegant way, but I tried to mimic the local

Re: [PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-16 Thread Ephrim Khong
On 15.07.2014 21:48, Junio C Hamano wrote: Ephrim Khong dr.kh...@gmail.com writes: +test_expect_success setup ' + GIT_OBJECT_DIRECTORY=.git//../.git/objects + export GIT_OBJECT_DIRECTORY Do you need this artificially strange environment settings for the problem to manifest

[PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-15 Thread Ephrim Khong
When adding alternate object directories, we try not to add the directory of the current repository to avoid cycles. Unfortunately, that test was broken, since it compared an absolute with a relative path. Signed-off-by: Ephrim Khong dr.kh...@gmail.com --- Since v2: Added Johannes' comments

[PATCH] sha1_file: do not add own object directory as alternate

2014-07-14 Thread Ephrim Khong
When adding alternate object directories, we try not to add the directory of the current repository to avoid cycles. Unfortunately, that test was broken, since it compared an absolute with a relative path. Signed-off-by: Ephrim Khong dr.kh...@gmail.com --- My first patch, so be harsh. I'm

Re: [PATCH v2] sha1_file: do not add own object directory as alternate

2014-07-14 Thread Ephrim Khong
When adding alternate object directories, we try not to add the directory of the current repository to avoid cycles. Unfortunately, that test was broken, since it compared an absolute with a relative path. Signed-off-by: Ephrim Khong dr.kh...@gmail.com --- As proposed by Duy, v2 of the patch

Re: [Bug] data loss with cyclic alternates

2014-07-13 Thread Ephrim Khong
Am 11.07.14 18:01, schrieb Junio C Hamano: Ephrim Khong dr.kh...@gmail.com writes: git seems to have issues with alternates when cycles are present (repo A has B/objects as alternates, B has A/objects as alternates). Yeah, don't do that. A thinks eh, the other guy must have it and B thinks

[Bug] data loss with cyclic alternates

2014-07-11 Thread Ephrim Khong
Hi, git seems to have issues with alternates when cycles are present (repo A has B/objects as alternates, B has A/objects as alternates). In such cases, gc and repack might delete objects that are present in only one of the alternates, leading to data loss. I understand that this is no big

Re: git log omits deleting merges

2014-03-24 Thread Ephrim Khong
Am 20.03.14 20:54, schrieb Jeff King: On Thu, Feb 20, 2014 at 08:35:33AM +0100, Ephrim Khong wrote: Hi, git log seems to omit merge commits that delete a file if --follow or --diff-filter=D is given. Below is a testcase. I'm not sure if it is desired behaviour for --diff-filter=D, but it's

git log omits deleting merges

2014-02-19 Thread Ephrim Khong
Hi, git log seems to omit merge commits that delete a file if --follow or --diff-filter=D is given. Below is a testcase. I'm not sure if it is desired behaviour for --diff-filter=D, but it's probably not correct that --follow _removes_ the merge commit from the log output. Thanks - Eph --

git blame: Not Committed Yet with clean WD

2014-02-13 Thread Ephrim Khong
Hi, for files that contain windows line endings in a repository with core.autocrlf=input, git blame will show lines as Not Committed Yet, even though they were not modified. Example: -- git init git config core.autocrlf false echo foo a unix2dos a git add a git commit -m initial commit git