Re: [PATCH 3/4] set_work_tree: use chdir_notify

2018-03-30 Thread Jeff King
On Thu, Mar 29, 2018 at 08:01:33PM +0200, Duy Nguyen wrote: > > I do kind of like that. I'm reasonably happy with the chdir_notify() > > interface, but it would be nicer still if we could get rid of it in the > > first place. It's true that we _could_ chdir from other places, but > > There's

Re: [PATCH 3/4] set_work_tree: use chdir_notify

2018-03-29 Thread Duy Nguyen
On Thu, Mar 29, 2018 at 7:50 PM, Jeff King wrote: > On Thu, Mar 29, 2018 at 07:02:21PM +0200, Duy Nguyen wrote: > >> On Wed, Mar 28, 2018 at 7:42 PM, Jeff King wrote: >> > When we change to the top of the working tree, we manually >> > re-adjust $GIT_DIR and call

Re: [PATCH 3/4] set_work_tree: use chdir_notify

2018-03-29 Thread Jeff King
On Thu, Mar 29, 2018 at 07:23:17PM +0200, Duy Nguyen wrote: > On Thu, Mar 29, 2018 at 7:02 PM, Duy Nguyen wrote: > > ... > > > > It's less code this way, but it uses up more of your (or my) time > > because even though the first set_git_dir() call actually happens at 8 > >

Re: [PATCH 3/4] set_work_tree: use chdir_notify

2018-03-29 Thread Jeff King
On Thu, Mar 29, 2018 at 07:02:21PM +0200, Duy Nguyen wrote: > On Wed, Mar 28, 2018 at 7:42 PM, Jeff King wrote: > > When we change to the top of the working tree, we manually > > re-adjust $GIT_DIR and call set_git_dir() again, in order to > > update any relative git-dir we'd

Re: [PATCH 3/4] set_work_tree: use chdir_notify

2018-03-29 Thread Duy Nguyen
On Thu, Mar 29, 2018 at 7:02 PM, Duy Nguyen wrote: > ... > > It's less code this way, but it uses up more of your (or my) time > because even though the first set_git_dir() call actually happens at 8 > places. Is it worth trying ? Never mind. I took a stab anyway. The setup

Re: [PATCH 3/4] set_work_tree: use chdir_notify

2018-03-29 Thread Duy Nguyen
On Wed, Mar 28, 2018 at 7:42 PM, Jeff King wrote: > When we change to the top of the working tree, we manually > re-adjust $GIT_DIR and call set_git_dir() again, in order to > update any relative git-dir we'd compute earlier. Another way to approach this problem is not delaying

[PATCH 3/4] set_work_tree: use chdir_notify

2018-03-28 Thread Jeff King
When we change to the top of the working tree, we manually re-adjust $GIT_DIR and call set_git_dir() again, in order to update any relative git-dir we'd compute earlier. Instead of the work-tree code having to know to call the git-dir code, let's use the new chdir_notify interface. There are two