Re: [PATCHv2] rev-parse: add --show-superproject-working-tree

2017-03-07 Thread Junio C Hamano
Looks more or less right but invoke "ls-files -z" and reading the \0 delimited output would be easier; otherwise you would have to worry about c-unquoting the pathname when the submodule is bound at a path with funny character (like a double-quote) in it. Also, returning the exact string of the pa

Re: [PATCHv2] rev-parse: add --show-superproject-working-tree

2017-03-07 Thread Junio C Hamano
Stefan Beller writes: > + if (!strcmp(arg, "--show-superproject-working-tree")) { > + const char *superproject = > get_superproject_working_tree(); > + if (superproject) > + puts(super

[PATCHv2] rev-parse: add --show-superproject-working-tree

2017-03-07 Thread Stefan Beller
In some situations it is useful to know if the given repository is a submodule of another repository. Add the flag --show-superproject-working-tree to git-rev-parse to make it easy to find out if there is a superproject. Signed-off-by: Stefan Beller --- * not RFC anymore, but for real this time