Skip to content

Replace all links to Git for Windows' (migrated) wiki #609

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

Merged
merged 2 commits into from
Mar 19, 2025
Merged

Conversation

dscho
Copy link
Member

@dscho dscho commented Mar 19, 2025

As of git-for-windows/git-for-windows.github.io#59, the pages of Git for Windows' wiki have been migrated to https://gitforwindows.org/. Let's avoid using the old links.

This trick was performed by using some GNU-specific `sed` extensions:

  sed -i "$(git grep git-for-windows/git/wiki/ |
    tr '>;#() ='\' '\n' |
    grep git-for-windows/git/wiki/ |
    sort |
    uniq |
    sed '# transform every wiki URL to a sed `s,,,` expression
        # using the GNU-specific extension where `s///` can use
        # other delimiters than `/`; We use both `,` and `=` separators
        # in the following.
        s/^/s,/ # prefix with `s,` of the `s,,,` expression
        h # store the `s,,` part of the `s,,,` in the hold space
        s,.*/,, # reduce to base name
        s/\(.*\)/\L\1/ # lowercase the base name (GNU-specific)
        s/[^0-9A-Za-z_]\+/-/g # replace non-alphanumeric runs with `-`
        # prefix with `https://gitforwindows.org/` and surround with
        # commas of the `s,,,` expression
        s=.*=,https://gitforwindows.org/&,g;=
        H # append it to the hold space
        x # move the `s,,,` expression from hold space
        # remove the newline that was inserted when appending to the
        # hold space
        s/\n//
    ')" $(git grep -l git-for-windows/git/wiki/)

In other words, it uses GNU sed to construct a GNU sed command that
replaces in-place all occurrences of the old wiki URLs with links
pointing to the respective new location.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho requested review from mjcheetham and rimrul March 19, 2025 10:26
@dscho dscho self-assigned this Mar 19, 2025
Together with the rest of the wiki pages, the FAQ was moved as part of
the move to the new Git for Windows website in
git-for-windows/git-for-windows.github.io#59.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho merged commit 42df794 into main Mar 19, 2025
7 checks passed
@dscho dscho deleted the no-more-wiki branch March 19, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants