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

Fix crash that occurs for git blame for older versions of git #55

Merged
merged 2 commits into from
Feb 6, 2023

Conversation

rzuckerm
Copy link
Contributor

@rzuckerm rzuckerm commented Feb 4, 2023

fixes #54

… [--help] [-C <path>] [-c <name>=<value>]

           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [--super-prefix=<path>] [--config-env=<name>=<envvar>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone     Clone a repository into a new directory
   init      Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add       Add file contents to the index
   mv        Move or rename a file, a directory, or a symlink
   restore   Restore working tree files
   rm        Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect    Use binary search to find the commit that introduced a bug
   diff      Show changes between commits, commit and working tree, etc
   grep      Print lines matching a pattern
   log       Show commit logs
   show      Show various types of objects
   status    Show the working tree status

grow, mark and tweak your common history
   branch    List, create, or delete branches
   commit    Record changes to the repository
   merge     Join two or more development histories together
   rebase    Reapply commits on top of another base tip
   reset     Reset current HEAD to the specified state
   switch    Switch branches
   tag       Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch     Download objects and refs from another repository
   pull      Fetch from and integrate with another repository or a local branch
   push      Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.
@rzuckerm rzuckerm marked this pull request as ready for review February 4, 2023 22:08
@rzuckerm rzuckerm changed the title Fix crash the occurs for git blame for older versions of git Fix crash that occurs for git blame for older versions of git Feb 4, 2023
Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

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

Great work! Hope this fixed the issue you were seeing on your end.

# keep track of whether it existed before
blame_path = Path(f"{self._temp_dir.name}/.git-blame-ignore-revs")
blame_path_exists = blame_path.exists()
blame_path.touch()
Copy link
Member

Choose a reason for hiding this comment

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

Had to do a bit of investigating with this line of code. I was worried it might overwrite an existing file, but it seems to work just fine.

@jrg94 jrg94 self-assigned this Feb 6, 2023
@jrg94 jrg94 added the bug Something isn't working label Feb 6, 2023
@jrg94 jrg94 merged commit b5caa63 into TheRenegadeCoder:main Feb 6, 2023
@rzuckerm rzuckerm deleted the fix-issue-54 branch February 6, 2023 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Crash in Repo._load_git_data when .git-blame-ignore-revs does not exist
2 participants