`git describe` skipping shallow fetched (grafted) tag

2019-07-07 Thread Anthony Sottile
I haven't been able to boil this down to a minimal reproduction yet but here's my current reproduction -- I'm very confused by the output I've gathered so far: ``` rm -rf repo1 git init repo1 cd repo1 git remote add origin https://github.com/asottile/pyupgrade git -c protocol.version=2 fetch origi

rev-parse's show-{cdup,prefix} inconsistent when pwd symlink

2019-07-07 Thread Oliver Ford
`git rev-parse --show-prefix` gives the symlinked directory, not pwd: ``` $ git init Initialized empty Git repository in [~]/git-test/.git/ $ mkdir realdir $ ln -s realdir symdir $ cd symdir $ pwd [~]/misc/git-test/symdir $ git rev-parse --show-prefix realdir/ ``` That might arguably be desirable

[RFC PATCH 4/5] test-oidmap: add 'get_all' subcommand

2019-07-07 Thread Christian Couder
Let's make it possible to test oidmap_get_next() by adding a 'get_all' subcommand that calls oidmap_get() once first and then oidmap_get_next() several times until there is no more entry with the same oid key. Signed-off-by: Christian Couder --- t/helper/test-oidmap.c | 17 + 1 f

[RFC PATCH 5/5] t0016: add 'add' and 'get_all' subcommand test

2019-07-07 Thread Christian Couder
Let's add a test case to test both the 'add' and 'get_all' subcommand from "test-oidmap.c", and through them oidmap_add() and oidmap_get_next() from "oidmap.{c,h}". Signed-off-by: Christian Couder --- t/t0016-oidmap.sh | 26 ++ 1 file changed, 26 insertions(+) diff --git

[RFC PATCH 3/5] test-oidmap: add back proper 'add' subcommand

2019-07-07 Thread Christian Couder
Let's making it ppossible to test oidmap_add() by adding an 'add' subcommand. Signed-off-by: Christian Couder --- t/helper/test-oidmap.c | 17 + 1 file changed, 17 insertions(+) diff --git a/t/helper/test-oidmap.c b/t/helper/test-oidmap.c index 0acf99931e..c19b41aa4f 100644 ---

[RFC PATCH 0/5] oidmap: handle entries with the same key

2019-07-07 Thread Christian Couder
This is an RFC patch series that is not intended to be merged for now, as it looks like we don't need oidmaps that can handle several entries with the same key yet. As I needed this for my work on reftable, I thought that I might as well post it, to get early feedback and to avoid duplicating work

[RFC PATCH 2/5] oidmap: add oidmap_get_next()

2019-07-07 Thread Christian Couder
For now "oidmap.h" gives us no way to get all the entries that have the same oid key from an oidmap, as oidmap_get() will always return the first entry. So let's add oidmap_get_next() for this purpose. Signed-off-by: Christian Couder --- oidmap.c | 8 oidmap.h | 6 ++ 2 files change

[RFC PATCH 1/5] oidmap: add oidmap_add()

2019-07-07 Thread Christian Couder
We will need to have more than one entry with the same oid key in an oidmap, which is not supported yet, as oipmap_put() replaces an existing entry with the same oid key. So let's add oidmap_add(). Signed-off-by: Christian Couder --- oidmap.c | 12 oidmap.h | 6 ++ 2 files chan