Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --directory option (closes #73) #104

Merged
merged 2 commits into from
Jun 4, 2020

Conversation

alistaircarscadden
Copy link
Contributor

No description provided.

@extrawurst
Copy link
Owner

Hey @alistaircarscadden thanks for looking into this. I love the simplicity of the solution. It did not even cross my mind to do it like that. I was expecting to have to search and change very place I am using CWD.

Does it have any downsides to switch the current working directory in your opinion?

@alistaircarscadden
Copy link
Contributor Author

@extrawurst
From my systems experience this is the usual way to do this. I think a shell actually does the same thing when you start a process, between fork(2) and exec(3), using chdir(2).

The notable effects are:

  • the gitui process will create child processes in it's working directory, which would (after this change) be wherever the user set it with -d.
  • relative paths in the process (../, ./somedir) are relative to the working directory, so they'd be relative to the new working directory too.
  • the change here does not effect the parent shell of gitui, so when you quit gitui you'd be back in the original directory.

I think these are all behaviours we want gitui to have.

@extrawurst
Copy link
Owner

Perfect thanks for clarifying! Any shorter alternative to directory? maybe path,folder? What do you think?

Can you also add this to the changelog?

@jugglerchris
Copy link

The common short option (used by make and git) would be -C. Make has --directory as a long option.

I quite like --in but I don't know of a precedent. :-)

@alistaircarscadden
Copy link
Contributor Author

@extrawurst

Can you also add this to the changelog?

Yes.

Any shorter alternative to directory

--dir ?

@jugglerchris

would be -C

At first glance -C/--directory is a bit dissonant to me, but I'm up for whatever.

@extrawurst
Copy link
Owner

Yes.

Cool!

At first glance -C/--directory is a bit dissonant to me, but I'm up for whatever.

I agree.
Lets stick to -d and --directory 👍

@alistaircarscadden
Copy link
Contributor Author

Can you also add this to the changelog?

Finished, now.

@extrawurst extrawurst merged commit 702c49a into extrawurst:master Jun 4, 2020
@extrawurst
Copy link
Owner

Thanks so much!❤️

@alistaircarscadden alistaircarscadden deleted the directory branch June 4, 2020 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants