Thread (1 message) 1 message, 1 author, 2021-10-06

Re: [PATCH v4 13/15] scalar: implement the `delete` command

From: Johannes Schindelin <hidden>
Date: 2021-10-06 20:48:45

Hi Matthew and Elijah,

On Mon, 4 Oct 2021, Matthew Cheetham wrote:
On 28 Sep 2021, at 7:24 am, Elijah Newren [off-list ref] wrote:
quoted
But if the current directory is inside the enlistment's directory,
didn't that happen because the parent process' current directory was
inside the enlistment directory?  Or was there some kind of directory
switching that scalar itself was doing causing it to be inside the
enlistment directory?
Yes to the latter. `setup_enlistment_directory` changes the current
directory much like `setup_git_directory`.
quoted
If the the current directory was inside the enlistment's directory
because it inherited a parent process' current directory, wouldn't
that also prevent deleting it?  If so, should there be a special check
for that case and pre-emptively returning an error rather than
attempting the recursive directory deletion and just spitting out an
error when it fails?
You are correct. Speaking to Johannes about this I believe he is looking
to add a check/error in a new patch series revision.
Indeed, I did notice GGG#1037, and I changed the code so that it detects
whether `scalar delete` was called from within the enlistment, and refuses
to run in that case. Users will have to call `scalar delete <path>` from
outside the enlistment.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help