-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve git-ignore
command
#1047
Conversation
bin/git-ignore
Outdated
@@ -34,22 +46,22 @@ function add_global { | |||
} | |||
|
|||
function show_local { | |||
cd "$(git root)" | |||
maybe_cd_to_git_root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should warn the user if this cmd doesn't run in git repo.
See #347 (comment)
@@ -11,18 +11,30 @@ function show_contents { | |||
fi | |||
} | |||
|
|||
function maybe_cd_to_git_root { | |||
local result= | |||
if result=$(git rev-parse --show-toplevel 2>/dev/null); then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add this cmd in https://github.com/tj/git-extras/blob/master/not_need_git_repo
add_patterns .gitignore "$@" | ||
} | ||
|
||
function show_private { | ||
cd "$(git root)" | ||
maybe_cd_to_git_root | ||
show_contents Private "${GIT_DIR}/info/exclude" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must require a git repo for setting the private ignorefile. As it's private to the git repo.
Sorry for the slow reply, I have addressed the feedback |
Closes #38
git ignore<TAB>
now shows file/directory namesCloses #347
Closes #427 (stale issue about file that does not exist)