GitoxideLabs / gitoxide

An idiomatic, lean, fast & safe pure Rust implementation of Git
Apache License 2.0
8.91k stars 303 forks source link

Outdated broken links from documentation into code #1627

Open EliahKagan opened 6 hours ago

EliahKagan commented 6 hours ago

Current behavior 😯

There were three broken links found while working on #1624 that I didn't include fixes for in 65f69f7 because there was no clear best way to fix them. For two of them, which will probably require updating planning information. I am not at all sure what should be done, though I've tried to suggest broad possibilities. Those are the ones that motivate this issue. For the third, I'm pretty sure what the correct fix is and I'll go ahead and open a PR for it, but I've included it here as well so it can be easily reviewed.

Please note that the broken links described in this issue were effectively unaffected by the change of Byron/gitoxide to GitoxideLabs/gitoxide in 64ff0a7: although that part of their URLs changed, they were broken in exactly the same way both before and after that change to their URLs.

In crate-status.md

That link is a 404, because it specifies a gix-pack path at a commit before git-pack was renamed to gix-pack:

https://github.com/GitoxideLabs/gitoxide/blob/795962b107d86f58b1f7c75006da256d19cc80ad/crate-status.md?plain=1#L232

Changing the path back to git-path gives:

https://github.com/GitoxideLabs/gitoxide/blob/8f9a55bb31af32b266d7c53426bc925361a627b2/git-pack/src/cache/delta/from_offsets.rs#L101-L105

With more context, this is:

https://github.com/GitoxideLabs/gitoxide/blob/8f9a55bb31af32b266d7c53426bc925361a627b2/git-pack/src/cache/delta/from_offsets.rs#L100-L110

But the code comment, which crate-status.md links to, went away in https://github.com/GitoxideLabs/gitoxide/commit/84ade1d23060f10bf6c8529f8f693d06660b4f4e. The commit message there is:

fix: Allow resolution of in-pack ref-deltas (#287)

This finally allows delta tree caches to be used on typical small packs returned by GitHub.

So maybe the item in crate-status.md is (partially?) completed or otherwise should be revised?

In general-tasks.md

That link is a 404, both because it specifies gix-odb at a commit before git-odb was renamed to gix-odb, and because the structure and content of the crate has changed such that I am not sure if any corresponding code still exists:

https://github.com/GitoxideLabs/gitoxide/blob/795962b107d86f58b1f7c75006da256d19cc80ad/general-tasks.md?plain=1#L15-L19

Changing the path back to git-odb gives:

https://github.com/GitoxideLabs/gitoxide/blob/2958145a0ae1ef582bbf88352f5567d5c2b5eaf0/git-odb/src/store/linked/find.rs#L33

With more context, this is:

https://github.com/GitoxideLabs/gitoxide/blob/2958145a0ae1ef582bbf88352f5567d5c2b5eaf0/git-odb/src/store/linked/find.rs#L11-L14

https://github.com/GitoxideLabs/gitoxide/blob/2958145a0ae1ef582bbf88352f5567d5c2b5eaf0/git-odb/src/store/linked/find.rs#L22

https://github.com/GitoxideLabs/gitoxide/blob/2958145a0ae1ef582bbf88352f5567d5c2b5eaf0/git-odb/src/store/linked/find.rs#L32-L35

As far as I can tell, this went away without being replaced by anything equivalent in https://github.com/GitoxideLabs/gitoxide/commit/8c5ae77f06a64c57df9a9ad1190266896a223dbe:

change!: Remove deprecated compound and linked object databases

The dynamic/general store is the only maintained can-do-it-all DB now.

So maybe this item should be removed (or heavily revised?) from general-tasks.md?

In gix-diff/src/tree/function.rs

The git_cmp_rs link in the gix_diff::tree::function::diff function's documentation comment is a 404, because it specifies a gix-object path at a commit before git-object was renamed to gix-object, and because the crate has been substantially reorganized:

https://github.com/GitoxideLabs/gitoxide/blob/795962b107d86f58b1f7c75006da256d19cc80ad/gix-diff/src/tree/function.rs#L18

https://github.com/GitoxideLabs/gitoxide/blob/795962b107d86f58b1f7c75006da256d19cc80ad/gix-diff/src/tree/function.rs#L27

Changing the path back to git-object gives:

https://github.com/GitoxideLabs/gitoxide/blob/a4d5f99c8dc99bf814790928a3bf9649cd99486b/git-object/src/mutable/tree.rs#L52-L55

With more context, this is:

https://github.com/GitoxideLabs/gitoxide/blob/a4d5f99c8dc99bf814790928a3bf9649cd99486b/git-object/src/mutable/tree.rs#L50-L56

This changed substantially in https://github.com/GitoxideLabs/gitoxide/commit/ca37915fbb0c43c7f01ae600d1da63d2f21eeb63 (#849). The comment went away, and the implementation was modified to fix #848. Although some code has moved around in the module, that implementation remains today:

https://github.com/GitoxideLabs/gitoxide/blob/795962b107d86f58b1f7c75006da256d19cc80ad/gix-object/src/tree/mod.rs#L263-L273

I'll open a PR that changes the git_cmp_rs link in the gix_diff::tree::function::diff documentation comment to point there. [Edit: I've opened #1628 for this.]

Expected behavior 🤔

I think references to code should either be current or otherwise that their significance to future development should be clear. For this reason, even though all links work when gix-* is changed back to git-*, I did not make any such changes in #1624 and I am not recommending them here, since it would then not be obvious how the text referencing the code ought to be understood.

Git behavior

Not applicable.

Steps to reproduce 🕹

See above.