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 --file option. #170

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add --file option. #170

wants to merge 2 commits into from

Conversation

bwelling
Copy link

This adds a --file option, allowing git open --file <path>, where <path> is a path within the repository, and can either be a file or directory.

This is similar to what was requested years ago in #54, but isn't automatic. Presumably it could be made automatic, if someone more familiar with git internals and better at writing shell scripts than me wanted it to be.

git-open Outdated
@@ -49,6 +52,11 @@ IFS='=' read -ra suffix_flag <<< "$suffix_flag"
function join_by { local IFS="$1"; shift; echo "$*"; }
suffix=$(join_by "=" "${suffix_flag[@]:1}")

# parse file from file=value
IFS='=' read -ra file_flag <<< "$file_flag"
function join_by { local IFS="$1"; shift; echo "$*"; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you redefining this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The join_by function definition was cut and pasted, and could probably be removed.

@bwelling
Copy link
Author

Does anyone care about this? It's been open for almost 2 months, with only a trivial (and addressed) comment.

@SuperSandro2000
Copy link
Contributor

It would be nice to have.

@nharsch
Copy link

nharsch commented Sep 1, 2021

+1 for this request, I'm currently using the feature branch in place of master

@pharmpy-dev-123
Copy link

Would it be better to have a more general --path instead? So we can also open directories in GitHub's navigator.

@pharmpy-dev-123
Copy link

Does this open the file in the current git checkout out branch or commit?

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.

None yet

4 participants