Improve `git-ignore` command by hyperupcall · Pull Request #1047 · tj/git-extras
|
|
||
| function show_local { | ||
| cd "$(git root)" | ||
| maybe_cd_to_git_root |
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)
|
|
||
| function maybe_cd_to_git_root { | ||
| local result= | ||
| if result=$(git rev-parse --show-toplevel 2>/dev/null); then |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| function show_private { | ||
| cd "$(git root)" | ||
| maybe_cd_to_git_root | ||
| show_contents Private "${GIT_DIR}/info/exclude" |
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.
vanpipy pushed a commit to vanpipy/git-extras that referenced this pull request
Sep 14, 2023This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters