Skip to content

Improve git-ignore command#1047

Merged
spacewander merged 2 commits intotj:masterfrom
hyperupcall:better-git-ignore
Jul 13, 2023
Merged

Improve git-ignore command#1047
spacewander merged 2 commits intotj:masterfrom
hyperupcall:better-git-ignore

Conversation

@hyperupcall
Copy link
Copy Markdown
Collaborator

@hyperupcall hyperupcall commented May 17, 2023

Closes #38

  • git ignore<TAB> now shows file/directory names

Closes #347

  • No longer prints "fatal: not a git repository"-type errors to console. If no (local) Git repository is present, handle gracefully

Closes #427 (stale issue about file that does not exist)

Comment thread bin/git-ignore Outdated

function show_local {
cd "$(git root)"
maybe_cd_to_git_root
Copy link
Copy Markdown
Collaborator

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)

Comment thread bin/git-ignore

function maybe_cd_to_git_root {
local result=
if result=$(git rev-parse --show-toplevel 2>/dev/null); then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread bin/git-ignore
function show_private {
cd "$(git root)"
maybe_cd_to_git_root
show_contents Private "${GIT_DIR}/info/exclude"
Copy link
Copy Markdown
Collaborator

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.

@hyperupcall
Copy link
Copy Markdown
Collaborator Author

Sorry for the slow reply, I have addressed the feedback

@spacewander spacewander merged commit 0b5d2cc into tj:master Jul 13, 2023
@hyperupcall hyperupcall deleted the better-git-ignore branch July 13, 2023 06:37
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.

Is makefile.msys duplicate? .gitignore without an initialized repo git ignore doesn't interact with tab completion

2 participants