git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/2] blame: respect .git-blame-ignore-revs automatically

From
AGAbhijeetsingh Meena via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 12, 2024, 04:37 UTC
Message-ID
<pull.1809.v2.git.1728707867.gitgitgadget@gmail.com>
In-Reply-To
<pull.1809.git.1728370892696.gitgitgadget@gmail.com>

Summary =======

This patch introduces the ability for git blame to automatically respect the .git-blame-ignore-revs file, which can help users streamline their workflows by ignoring revisions for non-functional changes.

The feature is inspired by similar practices in other projects like Chromium, and it aligns with needs expressed by users in discussions around revision-ignoring mechanisms for git blame.

I have incorporated suggestions provided during the review of patch v1, including improvements to the commit message and addressing how to override ignore revisions using a new option.

Patch Updates and Improvements ==============================

Changes since v1 ================

 * Updated the commit message for the first patch. I incorporated
   Kristoffer’s suggestions by directly using the example he provided,
   ensuring the commit message aligns with the project's standards.
 * Attempted to use --no-ignore-revs-file to bypass the
   .git-blame-ignore-revs file, but observed that it did not ignore the
   specified revisions.
 * Introduced the --override-ignore-revs option (short form: -O) as a
   straightforward method to override any configured revision ignores,
   providing users with more control.
 * For the second commit, I applied Kristoffer’s feedback in writing the
   commit message to ensure consistency and clarity.
Abhijeetsingh Meena (2):
  blame: respect .git-blame-ignore-revs automatically
  blame: introduce --override-ignore-revs to bypass ignore revisions
    list
 builtin/blame.c                       | 16 +++++++++++++++-
 t/t8015-blame-default-ignore-revs.sh  | 26 ++++++++++++++++++++++++++
 t/t8016-blame-override-ignore-revs.sh | 25 +++++++++++++++++++++++++
 3 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100755 t/t8015-blame-default-ignore-revs.sh
 create mode 100755 t/t8016-blame-override-ignore-revs.sh
base-commit: ef8ce8f3d4344fd3af049c17eeba5cd20d98b69f
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1809%2FEthan0456%2Fblame-auto-ignore-revs-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1809/Ethan0456/blame-auto-ignore-revs-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1809
Range-diff vs v1:
 1:  666404681d9 ! 1:  4ed930cab1b blame: respect .git-blame-ignore-revs automatically
     @@ Metadata
       ## Commit message ##
          blame: respect .git-blame-ignore-revs automatically
      
     -    Modify `git blame` to automatically respect a `.git-blame-ignore-revs`
     -    file if it exists in the repository. This file is used by many projects
     -    to ignore non-functional changes, such as reformatting or large-scale
     -    refactoring, when generating blame information.
     +    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`.
      
     -    Before this change, users had to manually specify the file with the
     -    `--ignore-revs-file` option. This update streamlines the process by
     -    automatically detecting the `.git-blame-ignore-revs` file, reducing
     -    manual effort.
     -
     -    This change aligns with the standardized practice in many repositories
     -    and simplifies the workflow for users.
     +    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 <abhijeet040403@gmail.com>
      
     @@ t/t8015-blame-default-ignore-revs.sh (new)
      +'
      +
      +test_done
     - \ No newline at end of file
 -:  ----------- > 2:  8d2fa3af796 blame: introduce --override-ignore-revs to bypass ignore revisions list
-- 
gitgitgadget
Previous: Phillip WoodNext: Abhijeetsingh Meena via GitGitGadget
Message 4 of 24 in “blame: respect .git-blame-ignore-revs automatically”
  1. blame: respect .git-blame-ignore-revs automaticallyAbhijeetsingh Meena via GitGitGadget, Oct 8, 2024
  2. Kristoffer HaugsbakkOct 8, 2024
  3. Phillip WoodOct 8, 2024
  4. 0/2 blame: respect .git-blame-ignore-revs automaticallyAbhijeetsingh Meena via GitGitGadget, Oct 12, 2024
  5. 1/2 blame: respect .git-blame-ignore-revs automaticallyAbhijeetsingh Meena via GitGitGadget, Oct 12, 2024
  6. Eric SunshineOct 12, 2024
  7. Eric SunshineOct 12, 2024
  8. Taylor BlauOct 14, 2024
  9. Abhijeetsingh MeenaOct 16, 2024
  10. Kristoffer HaugsbakkOct 12, 2024
  11. Phillip WoodOct 13, 2024
  12. Kristoffer HaugsbakkOct 14, 2024
  13. Abhijeetsingh MeenaOct 16, 2024
  14. Phillip WoodOct 13, 2024
  15. Abhijeetsingh MeenaOct 16, 2024
  16. Abhijeetsingh MeenaOct 22, 2024
  17. Eric SunshineOct 22, 2024
  18. 2/2 blame: introduce --override-ignore-revs to bypass ignore revisions listAbhijeetsingh Meena via GitGitGadget, Oct 12, 2024
  19. Eric SunshineOct 12, 2024
  20. Eric SunshineOct 12, 2024
  21. Kristoffer HaugsbakkOct 12, 2024
  22. Phillip WoodOct 13, 2024
  23. Abhijeetsingh MeenaOct 8, 2024
  24. Abhijeetsingh MeenaOct 8, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.