Skip to content
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

Add ProGit v1 redirects #1915

Open
wants to merge 64 commits into
base: gh-pages
Choose a base branch
from
Open

Add ProGit v1 redirects #1915

wants to merge 64 commits into from

Commits on Nov 11, 2024

  1. Add a script to figure out the ProGit v1 URLs

    In 2014, the second edition of the ProGit book was started, in 2016 this
    edition became the default, and in 2020 all v1 URLs were redirected to
    the landing page of v2.
    
    At some stage, the v1 links stopped working, returning a "500 Internal
    server error".
    
    After switching the git-scm.com site to a static Hugo-generated site,
    those links now return a "404 That page doesn't exist".
    
    This is far from an ideal situation.
    
    Unfortunately, in a static site, there is no way to install wildcard
    routes that would redirect to a better URL, therefore we have to
    enumerate all of the URLs that we want to redirect.
    
    Internet Archive to the rescue!
    
    This script downloads the tables of contents of the ProGit v1 book and
    its translations, and determines the URLs that had been active back
    then, maps them to the v2 equivalents (on a best effort basis), and then
    writes out a YAML file with that information.
    
    Signed-off-by: Johannes Schindelin <[email protected]>
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    94ea890 View commit details
    Browse the repository at this point in the history
  2. data: add ProGit v1 -> v2 mapping

    This file was generated by running script/extract-book-v1-urls.rb.
    
    Signed-off-by: Johannes Schindelin <[email protected]>
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    94dbb1e View commit details
    Browse the repository at this point in the history
  3. book: simplify file writing

    The `File.write(path, content)` form is quite a bit more readable than
    the long form.
    
    Signed-off-by: Johannes Schindelin <[email protected]>
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    0fc0898 View commit details
    Browse the repository at this point in the history
  4. ci(update-book): the English version owns /book/index.html

    The default language of the ProGit book is English, therefore
    https://git-scm.com/book should redirect to the table of contents of the
    English version of that book.
    
    This means that the `/external/book/content/book/en/_index.html` file
    needs to be part of the sparse checkout, otherwise the workflow run
    would not be able to update it (should it ever become necessary).
    
    This was not a problem so far because that file remained unchanged (and
    is likely to remain so for quite some time yet).
    
    Signed-off-by: Johannes Schindelin <[email protected]>
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    0591bf3 View commit details
    Browse the repository at this point in the history
  5. book: add aliases for the old ProGit v1 links

    Once upon a time, there first edition of the ProGit book was available
    on Git's home page, and the sun was shining. Then, one day in 2014, the
    sun shone brighter and work was begun to write the second edition of
    this book. At some stage, this became the default when directing web
    browsers to https://git-scm.com/book, and a few years later, 2020 or so,
    the links that formerly led to the first edition would redirect to v2.
    
    Then, one day, clouds moved across the sky and the redirects from v1 to
    v2 stopped working and instead a "500 Internal server error" page was
    shown.
    
    Time went by and nobody really knew how to fix it (or more likely,
    wasn't in the mood, or wanted other people to fix it).
    
    Finally, in the fall of 2024, git-scm.com was switched to a static web
    site, generated using Hugo, and local development became much easier.
    Naturally, the v1-to-v2 redirects were no longer in place and the v1
    links therefore showed 500 no longer, but a 404.
    
    Still, nobody knew how to fix it, or wasn't in the mood, or wanted other
    people to fix it for them.
    
    Until now. Now is the day when we resurrect the v1-to-v2 redirects, in
    even more glory than ever before, for now we redirect to the v2 sections
    that correspond to the v1 sections (as far as possible, that is)!
    
    Only one (slight) fly in the ointment: URLs to v1 sections of the book
    which contain anchors will keep those anchors as-are, and not translate
    them to the corresponding new anchors. Example:
    Git-Basics-Getting-a-Git-Repository#Cloning-an-Existing-Repository
    should redirect to v2/Git-Basics-Getting-a-Git-Repository#_git_cloning,
    but does not. It redirects to that page but still tries to find the
    anchor `#Cloning-an-Existing-Repository`.
    
    Alas, this is where I do not know how to fix it, or ain't in the mood,
    or want other people to fix it for themselves.
    
    This commit addresses git#1782
    
    Signed-off-by: Johannes Schindelin <[email protected]>
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    7597087 View commit details
    Browse the repository at this point in the history
  6. book: update be

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    54fe5e1 View commit details
    Browse the repository at this point in the history
  7. book: update id

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    73ff03d View commit details
    Browse the repository at this point in the history
  8. book: update zh-tw

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    2c25dc1 View commit details
    Browse the repository at this point in the history
  9. book: update fr

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    bf5ff78 View commit details
    Browse the repository at this point in the history
  10. book: update it

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    9fe02c6 View commit details
    Browse the repository at this point in the history
  11. book: update sl

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    e7d3e01 View commit details
    Browse the repository at this point in the history
  12. book: update uk

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    2e9ee74 View commit details
    Browse the repository at this point in the history
  13. book: update fa

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    186ef74 View commit details
    Browse the repository at this point in the history
  14. book: update az

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    7b50155 View commit details
    Browse the repository at this point in the history
  15. book: update de

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    9ee4f05 View commit details
    Browse the repository at this point in the history
  16. book: update gr

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    a572405 View commit details
    Browse the repository at this point in the history
  17. book: update nl

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    116f18f View commit details
    Browse the repository at this point in the history
  18. book: update bg

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    f5e33e5 View commit details
    Browse the repository at this point in the history
  19. book: update ko

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    d785435 View commit details
    Browse the repository at this point in the history
  20. book: update pt-pt

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    e8d6fc5 View commit details
    Browse the repository at this point in the history
  21. book: update es

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    196bc70 View commit details
    Browse the repository at this point in the history
  22. book: update ms

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    9945ab3 View commit details
    Browse the repository at this point in the history
  23. book: update sr

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    9c212f1 View commit details
    Browse the repository at this point in the history
  24. book: update en

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    148a8b6 View commit details
    Browse the repository at this point in the history
  25. book: update tl

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    9157fb6 View commit details
    Browse the repository at this point in the history
  26. book: update sv

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    7a663ac View commit details
    Browse the repository at this point in the history
  27. book: update cs

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    d73e7a6 View commit details
    Browse the repository at this point in the history
  28. book: update ja

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    40115bb View commit details
    Browse the repository at this point in the history
  29. book: update pl

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    20dff42 View commit details
    Browse the repository at this point in the history
  30. book: update zh

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    e5f1b4e View commit details
    Browse the repository at this point in the history
  31. book: update mk

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    27ed14c View commit details
    Browse the repository at this point in the history
  32. book: update tr

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    336be63 View commit details
    Browse the repository at this point in the history
  33. book: update pt-br

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    841f9b4 View commit details
    Browse the repository at this point in the history
  34. book: update ru

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    12ee764 View commit details
    Browse the repository at this point in the history
  35. book: update uz

    Updated via the `update-book.yml` GitHub workflow.
    dscho committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    54275b7 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    5c481f9 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    efb0c32 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    96c9cc9 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    492e526 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    6d360bb View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    6abf276 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    492af69 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    1a0a44c View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    473d684 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    78a931f View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    d92f6be View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    b7c85c4 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    bcee6d5 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    37ccb4a View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    600edb6 View commit details
    Browse the repository at this point in the history
  51. Configuration menu
    Copy the full SHA
    ad0d271 View commit details
    Browse the repository at this point in the history
  52. Configuration menu
    Copy the full SHA
    e4c240a View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    9595fe4 View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    708d8c2 View commit details
    Browse the repository at this point in the history
  55. Configuration menu
    Copy the full SHA
    7ad0bb7 View commit details
    Browse the repository at this point in the history
  56. Configuration menu
    Copy the full SHA
    5aaf357 View commit details
    Browse the repository at this point in the history
  57. Configuration menu
    Copy the full SHA
    a54a4af View commit details
    Browse the repository at this point in the history
  58. Configuration menu
    Copy the full SHA
    06be71f View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    0d02288 View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    9c859c5 View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    2f7b6f6 View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    6138fb7 View commit details
    Browse the repository at this point in the history
  63. Configuration menu
    Copy the full SHA
    528a5c2 View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    8d9bfac View commit details
    Browse the repository at this point in the history