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

2017-03-17 Thread Jonathan Nieder
Hi,

Stefan Beller wrote:

> Add the flag --show-superproject-working-tree to git-rev-parse
> to make it easy to find out if there is a superproject. When no
> superproject exists, the output will be empty.

I'm a little late for this, but think it's better to comment late than
never.

After this patch, git rev-parse has two options relating to the working
tree:

git rev-parse --is-inside-work-tree
git rev-parse --show-superproject-working-tree

Is this inconsistency necessary?  Now that there is a "git worktree"
command that allows making a second working tree for the same
repository, I would have thought we had standardized on work tree as
the name in UI.

Thoughts?
Jonathan


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

2017-03-08 Thread Junio C Hamano
Stefan Beller  writes:

>  *this patch*
>  
> * Documentation shamelessly stolen from Junio.

You stole it, and then ...

> +test_expect_success 'showing the superproject correctly' '
> + git rev-parse --show-superproject-working-tree >out &&
> + test_must_be_empty out &&

... made sure that the newly documented behaviour is tested as a
feature.  Good.

> + test_create_repo super &&
> + test_commit -C super test_commit &&
> + test_create_repo sub &&
> + test_commit -C sub test_commit &&
> + git -C super submodule add ../sub dir/sub &&
> + echo $(pwd)/super >expect  &&
> + git -C super/dir/sub rev-parse --show-superproject-working-tree >out &&
> + test_cmp expect out
> +'
> +