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

blame: respect .git-blame-ignore-revs automatically #1809

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

Commits on Oct 11, 2024

  1. blame: respect .git-blame-ignore-revs automatically

    git-blame(1) can ignore a list of commits with `--ignore-revs-file`.
    This is useful for marking uninteresting commits like formatting
    changes, refactors and whatever else should not be “blamed”.  Some
    projects even version control this file so that all contributors can
    use it; the conventional name is `.git-blame-ignore-revs`.
    
    But each user still has to opt-in to the standard ignore list,
    either with this option or with the config `blame.ignoreRevsFile`.
    Let’s teach git-blame(1) to respect this conventional file in order
    to streamline the process.
    
    Signed-off-by: Abhijeetsingh Meena <[email protected]>
    Ethan0456 committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    4ed930c View commit details
    Browse the repository at this point in the history
  2. blame: introduce --override-ignore-revs to bypass ignore revisions list

    The git blame command can ignore a list of revisions specified either
    through the --ignore-revs-file option or the blame.ignoreRevsFile
    configuration. This feature is useful for excluding irrelevant
    commits, such as formatting changes or large refactors, from blame
    annotations.
    
    However, users may encounter cases where they need to
    temporarily override these configurations to inspect all commits,
    even those excluded by the ignore list. Currently, there is no
    simple way to bypass all ignore revisions settings in one go.
    
    This patch introduces the --override-ignore-revs option (or -O),
    which allows users to easily bypass the --ignore-revs-file
    option, --ignore-rev option and the blame.ignoreRevsFile
    configuration. When this option is used, git blame will completely
    disregard all configured ignore revisions lists.
    
    The motivation behind this feature is to provide users with more
    flexibility when dealing with large codebases that rely on
    .git-blame-ignore-revs files for shared configurations, while
    still allowing them to disable the ignore list when necessary
    for troubleshooting or deeper inspections.
    
    Signed-off-by: Abhijeetsingh Meena <[email protected]>
    Ethan0456 committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    8d2fa3a View commit details
    Browse the repository at this point in the history