FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

tools: add `.git-blame-ignore-revs` file by RaisinTen · Pull Request #43017 · nodejs/node · GitHub

/ node Public

tools: add .git-blame-ignore-revs file - #43017

Closed
RaisinTen wants to merge 2 commits into
nodejs:mainfrom
RaisinTen:add-.git-blame-ignore-revs
Closed

tools: add .git-blame-ignore-revs file#43017
RaisinTen wants to merge 2 commits into
nodejs:mainfrom
RaisinTen:add-.git-blame-ignore-revs

Conversation

RaisinTen commented May 9, 2022
edited
Loading

Copy link
Copy Markdown
Member

This would make the GitHub blame UI ignore the revisions mentioned in
the .git-blame-ignore-revs file. For now, it ignores the change
introduced in 6afd3fc as asked for in #42752 (comment).
This would make the GitHub blame UI ignore the revisions mentioned in
the .git-blame-ignore-revs file. For now, it ignores the changes
introduced in:

Refs: https://github.blog/changelog/2022-03-24-ignore-commits-in-the-blame-view-beta
Signed-off-by: Darshan Sen raisinten@gmail.com

cc @targos

nodejs-github-bot added the meta Issues and PRs related to the general management of the project. label May 9, 2022
RaisinTen added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label May 9, 2022

targos commented May 9, 2022

Copy link
Copy Markdown
Member

Changes to this file would need to be adapted to work on release branches. I don't know how we should handle this.

Copy link
Copy Markdown
Member Author

Maybe we shouldn't backport this change to the release branches? Electron didn't backport the change that added this file - electron/electron#33171.

targos commented May 9, 2022

Copy link
Copy Markdown
Member

Maybe we shouldn't backport this change to the release branches? Electron didn't backport the change that added this file - electron/electron#33171.

I'm fine with that. We should probably add a rule to label-pr-config.yml so we don't forget to add the label.

RaisinTen commented May 9, 2022
edited
Loading

Copy link
Copy Markdown
Member Author

Done, mapped it to a https://github.com/nodejs/node/labels/dont-backport label.

targos commented May 9, 2022

Copy link
Copy Markdown
Member

Done, mapped it to a dont-backport label.

Is it a special placeholder for all dont-land-on-* labels?

Copy link
Copy Markdown
Member Author

Yes, that's the intention.

targos commented May 9, 2022

Copy link
Copy Markdown
Member

Okay, that seems useful but some things will have to be adapted for it.
I found:

mscdex commented May 9, 2022

Copy link
Copy Markdown
Contributor

Why are we using this feature?

richardlau commented May 9, 2022
edited
Loading

Copy link
Copy Markdown
Member

Done, mapped it to a dont-backport PRs that should not be backported to any release line. label.

Can we keep the individual dont-land-on-* labels? dont-backport is going to introduce ambiguity.

Copy link
Copy Markdown
Member Author

@mscdex

Why are we using this feature?

From https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view:

This can be useful when a few commits make extensive changes to your code.

RaisinTen commented May 10, 2022
edited
Loading

Copy link
Copy Markdown
Member Author

@richardlau

Can we keep the individual dont-land-on-* labels? dont-backport is going to introduce ambiguity.

Yes, we could do that but that would leave us with 2 options:

  1. apply all the dont-land-on-* labels manually whenever we make changes to this file OR
  2. we could map this file to all the currently present dont-land-on-* labels in .github/label-pr-config.yml, so that the bot applies those automatically whenever a change touches this file but the downside is that it would require us to update the label list whenever there is a new major branch or if a branch goes EOL

I'll delete the dont-backport label and stick to option 1 if there are no objections by the EOD. (Done)

RaisinTen removed the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label May 10, 2022

mscdex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This can be useful when a few commits make extensive changes to your code.

I get that, but in general it seems impossible to know if someone will want to find the changes in any particular commit (big or small), so ignoring commits isn't very helpful.

Copy link
Copy Markdown
Member Author

@mscdex

I get that, but in general it seems impossible to know if someone will want to find the changes in any particular commit (big or small), so ignoring commits isn't very helpful.

In its current state, the PR is not about adding a general definition for all kinds of commits we want to include in this file. It's just about including 6afd3fc as asked for in #42752 (comment). The comment has some upvotes and no objections, so I took that as a clear indication of - yes, this looks like a good idea! That's why, I think it would be good if we add this commit to the list unless we have a concrete answer to this question - Why would someone want to find a change in 6afd3fc?

mscdex commented May 18, 2022

Copy link
Copy Markdown
Contributor

@mscdex do you still feel -1 about ignoring this commit?

Considering my comments have all been about the feature being used here and not any specific commits, technically yes.

Copy link
Copy Markdown
Member

Maybe we shouldn't backport this change to the release branches? Electron didn't backport the change that added this file - electron/electron#33171.

I'm not sure if this has already been considered - but this file will end up on future release branches (v19.x-staging onwards). That may not be a problem at all. But I figured I should mention because we will be in a state where this file exists on some release branches and not others.

targos commented May 19, 2022

Copy link
Copy Markdown
Member

@BethGriggs I think it's fine for the file to end up in release branches.
We can also decide to let it be backported automatically to remove releaser burden, just knowing that some commit hashes might not exist in the branches (it probably won't break GitHub).

LiviaMedeiros left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Would landing this alone give a greenish light to huge code churns (for example, enforcing non-controversal lint rules)?

Comment thread .git-blame-ignore-revs Outdated

Copy link
Copy Markdown
Member Author

Would landing this alone give a greenish light to huge code churns (for example, enforcing non-controversal lint rules)?

I believe so, yes!

Co-authored-by: Livia Medeiros <74449973+LiviaMedeiros@users.noreply.github.com>
RaisinTen added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label May 22, 2022

BridgeAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I personally feel like this does not really benefit us. We have to go through lots of blame steps anyway. I would rather not skip anything in case it has indeed been added. I would for example compare changes between two revisions and if there's a change in-between that I did not notice, it'll definitely be confusing.

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think maintaining this file will be too much of work to be useful.

Copy link
Copy Markdown
Member Author

I think maintaining this file will be too much of work to be useful.

@mcollina how is this a maintenance burden? No one is obliged to update this file, it's more of an opt-in thing - if someone wants a commit to be ignored from the blame UI, they could add the commit info to this file. Not updating this file will not cause any issues.

Copy link
Copy Markdown
Member

I'm somewhat -0 on this. I sometimes use the blame UI when comparing across release branches. Not that this PR should be blocked because of one person's workflow - I just think there's a non-zero chance of it introducing confusion by hiding the piece of blame history that someone is actively looking for.

mcollina commented Jun 1, 2022

Copy link
Copy Markdown
Member

I think maintaining this file will be too much of work to be useful.

@mcollina how is this a maintenance burden? No one is obliged to update this file, it's more of an opt-in thing - if someone wants a commit to be ignored from the blame UI, they could add the commit info to this file. Not updating this file will not cause any issues.

I'm not seeing the reasoning behind doing so.
Landing PRs is hard enough already, doing this change to add a commit that will not work across multiple release lines it does not look appealing.

Copy link
Copy Markdown
Member Author

I'm somewhat -0 on this. I sometimes use the blame UI when comparing across release branches. Not that this PR should be blocked because of one person's workflow - I just think there's a non-zero chance of it introducing confusion by hiding the piece of blame history that someone is actively looking for.

@BethGriggs when a commit gets backported to a release branch, doesn't it get a SHA that's different from the SHA in the HEAD branch, i.e., the one tracked in this file? If the SHA is different, this file won't hide it from the blame UI.

Copy link
Copy Markdown
Member Author

I'm not seeing the reasoning behind doing so.

@mcollina it's because such commits pollute the GitHub blame output, see #41768 (comment).

Landing PRs is hard enough already

Why would landing a change to this file be hard? It won't even require a Jenkins CI run because it doesn't affect the node binary.

Copy link
Copy Markdown
Member

@BethGriggs when a commit gets backported to a release branch, doesn't it get a SHA that's different from the SHA in the HEAD branch, i.e., the one tracked in this file? If the SHA is different, this file won't hide it from the blame UI.

I think the answer is both yes and no 😅 . For new majors, we mirror master up until the vN.0.0 release commit. So the SHAs could match those on master in some release branches. I think it would depend on where the specific commit is in history - but I do believe this means it's possible it could match in some release branches and not others.

I don't want to derail with obscure (likely rare?) cases, just to share my non-blocking concerns that this might get confusing.

mcollina dismissed their stale review June 6, 2022 09:27

Moving my concerns to a soft -0. I'm not approving this but if others feels strongly about it, do it.

Copy link
Copy Markdown
Member

Would landing this alone give a greenish light to huge code churns (for example, enforcing non-controversal lint rules)?

I'm not so sure; messing up git blame is just one downside of large diffs. For example, huge diffs usually cause other open PRs or local branches to get stuck on merge conflicts.

Copy link
Copy Markdown
Member Author

Would landing this alone give a greenish light to huge code churns (for example, enforcing non-controversal lint rules)?

I'm not so sure; messing up git blame is just one downside of large diffs. For example, huge diffs usually cause other open PRs or local branches to get stuck on merge conflicts.

I guess running into merge conflicts is a fate of PRs that stay open long enough. However, if the diff in question was introduced by a change that enforces a lint rule, it could be resolved by first accepting the changes already present in the PR branch during the rebase (git rebase -X theirs main) and then committing the changes introduced by the formatter.

cjihrig commented Jun 27, 2022

Copy link
Copy Markdown
Contributor

I'm -1 on this for all of the reasons previously mentioned. I also won't block this, but I think you should consider the number of people who have raised concerns here, as well as the explicit request for changes.

jasnell commented Jun 27, 2022

Copy link
Copy Markdown
Member

Really not a fan of this.

LiviaMedeiros commented Jun 27, 2022
edited
Loading

Copy link
Copy Markdown
Member

Would landing this alone give a greenish light to huge code churns (for example, enforcing non-controversal lint rules)?

I'm not so sure; messing up git blame is just one downside of large diffs. For example, huge diffs usually cause other open PRs or local branches to get stuck on merge conflicts.

Summarizing downsides of large diffs:

  1. It pollutes git blame across whole codebase.
  2. It causes merge conflicts on branches basing on commits before churn.
  3. It pollutes diffs between release lines.

I'm seeing (1) as a huge problem that might be effectively solved by this file.
(2) and (3) are huge as well, but their significance is temporal.

On the other side we have accepted-but-not-enforced linter rules such as trailing commas and sorted keys. It doesn't look as important, but it burdens authors and reviewers constantly, making them to keep an eye on it.

On larger timescale, unless there are other important problems, I believe that getting rid of "eternal" issue is worth it, and eventually has to be done.


Regarding arguments that usually we have to do extra steps while using git blame anyway and usually we don't want to hide those steps: it is applicable to current state of repository, but might be changed if a churn happens in the future.

I've tried to emulate potential issue by making a copy of repository with grotesque churn (by messing with intent and quotes eslint rules and reverting back) injected at 2022-04-01, and .git-blame-ignore-revs pushed at 2022-06-28. For example, lib/assert.js without and with this feature added. I hope it helps to decide if churn can disrupt gitblaming workflow.

Currently I'm seeing two issues:

  1. This feature still can't be toggled off in GitHub UI. I'm not sure if there is any non-ill-intentioned situation where anyone wants to hide a commit without possibility to unhide it. Perhaps it should be fixed on GH side.
    Lack of option to turn it off would block ignoring commits that have non-epsilon chance to be wanted by someone.
  2. Some lines (for example, 165-166 or 170) still show commits that are supposed to be ignored.
    Regular git blame in terminal does the same.

Also worth pointing out that blame looks for ignore-revs file on "current" commit, so the file might be outdated or missing. It means that commits-to-be-hidden should be added as soon as possible to make it effective, and adding very old commits might not be useful.

Tl;dr I think it would be a good idea to add this file early but to not populate it with even slightly controversal commits at least until this feature becomes optional. Each commit candidate can be discussed individually later.

Copy link
Copy Markdown
Member Author

I don't feel strongly about doing this anymore but if anyone else does, please feel free to take over the task of adding this file!

RaisinTen closed this Jun 29, 2022
RaisinTen removed the tsc-agenda Issues and PRs to discuss during the meetings of the TSC. label Jun 29, 2022
RaisinTen deleted the add-.git-blame-ignore-revs branch June 29, 2022 13:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. meta Issues and PRs related to the general management of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.


Back | FazBrowse Home | New Git URL