-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Add doctor command to write commit-graphs #20007
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
Conversation
This PR adds a doctor command to write the commit-graphs for the repositories: `gitea doctor --run check-commit-graphs --fix` Signed-off-by: Andrew Thornton <[email protected]>
|
could be moved to 1.17 |
Signed-off-by: Andrew Thornton <[email protected]>
|
|
||
| if !isExist { | ||
| commitGraphsDir := path.Join(repo.RepoPath(), `objects/info/commit-graphs`) | ||
| isExist, err = util.IsExist(commitGraphsDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there a case missing that this directory is not empty?
Or what is the file format inside this directory?
Shouldn't this be checked as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think its worth checking for the format of the directory and/or file at this point.
If you are really interested in how commit graphs are created you are welcome to peruse:
and
Here is the salient points for the contents of commit-graphs
A commit-graph chain uses multiple files, and we use a fixed naming convention
to organize these files. Each commit-graph file has a name
`$OBJDIR/info/commit-graphs/graph-{hash}.graph` where `{hash}` is the hex-
valued hash stored in the footer of that file (which is a hash of the file's
contents before that hash). For a chain of commit-graph files, a plain-text
file at `$OBJDIR/info/commit-graphs/commit-graph-chain` contains the
hashes for the files in order from "lowest" to "highest".
We could assert that the chain file exists instead of the directory I guess.
This PR adds a doctor command to write the commit-graphs for the repositories:
gitea doctor --run check-commit-graphs --fixSigned-off-by: Andrew Thornton [email protected]