-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support
.git-blame-ignore-revs
file (#26395)
Closes #26329 This PR adds the ability to ignore revisions specified in the `.git-blame-ignore-revs` file in the root of the repository. ![grafik](https://github.com/go-gitea/gitea/assets/1666336/9e91be0c-6e9c-431c-bbe9-5f80154251c8) The banner is displayed in this case. I intentionally did not add a UI way to bypass the ignore file (same behaviour as Github) but you can add `?bypass-blame-ignore=true` to the url manually. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
- Loading branch information
1 parent
c766140
commit ed64f1c
Showing
19 changed files
with
306 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
date: "2023-08-14T00:00:00+00:00" | ||
title: "Blame File View" | ||
slug: "blame" | ||
sidebar_position: 13 | ||
toc: false | ||
draft: false | ||
aliases: | ||
- /en-us/blame | ||
menu: | ||
sidebar: | ||
parent: "usage" | ||
name: "Blame" | ||
sidebar_position: 13 | ||
identifier: "blame" | ||
--- | ||
|
||
# Blame File View | ||
|
||
Gitea supports viewing the line-by-line revision history for a file also known as blame view. | ||
You can also use [`git blame`](https://git-scm.com/docs/git-blame) on the command line to view the revision history of lines within a file. | ||
|
||
1. Navigate to and open the file whose line history you want to view. | ||
1. Click the `Blame` button in the file header bar. | ||
1. The new view shows the line-by-line revision history for a file with author and commit information on the left side. | ||
1. To navigate to an older commit, click the ![versions](/octicon-versions.svg) icon. | ||
|
||
## Ignore commits in the blame view | ||
|
||
All revisions specified in the `.git-blame-ignore-revs` file are hidden from the blame view. | ||
This is especially useful to hide reformatting changes and keep the benefits of `git blame`. | ||
Lines that were changed or added by an ignored commit will be blamed on the previous commit that changed that line or nearby lines. | ||
The `.git-blame-ignore-revs` file must be located in the root directory of the repository. | ||
For more information like the file format, see [the `git blame --ignore-revs-file` documentation](https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt). | ||
|
||
### Bypassing `.git-blame-ignore-revs` in the blame view | ||
|
||
If the blame view for a file shows a message about ignored revisions, you can see the normal blame view by appending the url parameter `?bypass-blame-ignore=true`. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ref: refs/heads/master |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[core] | ||
repositoryformatversion = 0 | ||
filemode = true | ||
bare = true |
Binary file added
BIN
+98 Bytes
modules/git/tests/repos/repo6_blame/objects/31/bb4b42cecf0a98fc9a32fc5aaeaf53ec52643c
Binary file not shown.
Binary file added
BIN
+35 Bytes
modules/git/tests/repos/repo6_blame/objects/3b/0f66d8b065f8adbf2fef7d986528c655b98cb1
Binary file not shown.
Binary file added
BIN
+167 Bytes
modules/git/tests/repos/repo6_blame/objects/45/fb6cbc12f970b04eacd5cd4165edd11c8d7376
Binary file not shown.
Binary file added
BIN
+24 Bytes
modules/git/tests/repos/repo6_blame/objects/49/7701e5bb8676e419b93875d8f0808c7b31aed9
Binary file not shown.
Binary file added
BIN
+175 Bytes
modules/git/tests/repos/repo6_blame/objects/54/4d8f7a3b15927cddf2299b4b562d6ebd71b6a7
Binary file not shown.
Binary file added
BIN
+57 Bytes
modules/git/tests/repos/repo6_blame/objects/a8/9199e8dea077e4a8ba0bc01bc155275cfdd044
Binary file not shown.
Binary file added
BIN
+134 Bytes
modules/git/tests/repos/repo6_blame/objects/af/7486bd54cfc39eea97207ca666aa69c9d6df93
Binary file not shown.
Binary file added
BIN
+54 Bytes
modules/git/tests/repos/repo6_blame/objects/b8/d1ba1ccb58ee3744b3d1434aae7d26ce2d9421
Binary file not shown.
Binary file added
BIN
+54 Bytes
modules/git/tests/repos/repo6_blame/objects/ca/411a3b842c3caec045772da42de16b3ffdafe8
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
544d8f7a3b15927cddf2299b4b562d6ebd71b6a7 |
This file contains 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
Oops, something went wrong.