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

Git blame ignore revs #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mbarbin
Copy link
Contributor

@mbarbin mbarbin commented Jan 5, 2025

I have seen this pattern in use in the ppxlib project, where revision applying ocamlformat upgrades are listed in this file. I don't have first-hand experience with this, but thought I would create a draft PR as a reminder to look into it at a later point.

There is no point in filling the revs too early, because the actual SHA is subject to many changes through force rebases before the fmt commit ends up being merged into main.

  • Rebase and fill the actual revision.
  • Look a bit into what this file is and how to use it (I suspect this is automatically used by git blame given the name, but just to double check since I am not familiar with this as of yet).

@mbarbin mbarbin force-pushed the git-blame-ignore-revs branch from 12798d5 to e92714a Compare January 7, 2025 20:26
@mbarbin
Copy link
Contributor Author

mbarbin commented Jan 7, 2025

I looked into what this file may be used for. My current understanding is that it should be manually provided to git blame, then it is useful. There may exists other conventions or tools that make use of this by default.

At any rate, this seems to do the trick:

mathieu:~/dev/forks/miou$ git blame lib/miou_unix.mli --ignore-revs-file=.git-blame-ignore-revs > /tmp/blame-ignoring-revs
mathieu:~/dev/forks/miou$ git blame lib/miou_unix.mli > /tmp/blame
mathieu:~/dev/forks/miou$ diff /tmp/blame{,-ignoring-revs} | head -n 6
3,4c3,4
< d5573222 (Mathieu Barbin      2025-01-05 17:51:34 +0100   3)     This module offers a re-implementation of the I/O according to Miou's model.
< d5573222 (Mathieu Barbin      2025-01-05 17:51:34 +0100   4)     This module is essentially concerned with reading and writing
---
> 97f1a5f7 (Calascibetta Romain 2024-04-02 11:24:50 +0200   3)     This module offers a re-implementation of the I/O according to Miou's model.
> 11e7b04c (Calascibetta Romain 2024-09-22 13:20:38 +0200   4)     This module is essentially concerned with reading and writing

@mbarbin mbarbin marked this pull request as ready for review January 7, 2025 20:39
@dinosaure
Copy link
Contributor

I'm ok with this PR but it requires a little documentation. I will do something probably tomorrow on this topic and see how to explain this file and how to fill it properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants