Re: [PATCH] worktree: provide better prefix to go back to original cwd
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 6, 2010, 18:32 UTC
- Message-ID
- <7v4ocz18az.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20101006180727.GA2118@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
> Are there any examples to illustrate whether teaching --show-prefix to > do what your --worktree-to-cwd does would be a good or bad idea? > (Just curious.)
Do these additions interact well with the notion of "we are in the working tree" vs "we are outside the working tree"? Even when we happen to know via GIT_WORK_TREE that the root of the working tree is /var/tmp/junk, we should correctly diagnse that we are outside the working tree when we are in /var/tmp/, and require_work_tree should say "no you are not allowed to do this", no?
Show 15 quoted lines
>> --- a/cache.h
>> +++ b/cache.h
>> @@ -1110,6 +1110,8 @@ const char *split_cmdline_strerror(int cmdline_errno);
>> /* git.c */
>> struct startup_info {
>> int have_repository;
>> + char *cwd_to_worktree; /* chdir("this"); from cwd would return to worktree */
>> + char *worktree_to_cwd; /* chdir("this"); from worktree would return to cwd */
>
> Comment nit: would
>
> /* path from original cwd to worktree */
> /* path from worktree to original cwd */
>
> be clearer?Much better.