Re: [PATCH] worktree: provide better prefix to go back to original cwd
- From
Chris Packham <judge.packham@gmail.com>
- Date
- Oct 6, 2010, 15:47 UTC
- Message-ID
- <4CAC9A21.7030401@gmail.com>
- In-Reply-To
- <1286373578-2484-1-git-send-email-pclouds@gmail.com>
On 06/10/10 06:59, Nguyễn Thái Ngọc Duy wrote:
Show 18 quoted lines
> When both GIT_DIR and GIT_WORK_TREE are set, if cwd is outside worktree, > prefix (the one passed to every builtin commands) will be set to NULL, > which means "user stays at worktree topdir". > > As a consequence, command line arguments are supposed to be relative > to worktree topdir, not current working directory. Not very intuitive. > Moreover, output from such situation is (again) relative to worktree > topdir. Users are expected to understand that. > > This patch allows builtin commands access to original cwd even if it's > outside worktree, via cwd_to_worktree and worktree_to_cwd fields. As > the name implies, if you stay at original cwd, "cd $(cwd_to_worktree)" > would take you to worktree topdir and vice versa. > > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> > --- > startup_info->cwd_to_worktree would be as same as opt.submodule_prefix > in your 2/3 patch.
Thanks. I must admit I was struggling a little with implementing this part. I'll be sending out a re-roll of my series shortly and I'll include your patch if Junio doesn't pick it up on its own. I was also planning on re-basing my patches on top of next or pu so more people can actually compile it.