Cleanup and better documentation of sync-all script

Authored by thomie on Sep 1 2014, 3:12 PM.


Cleanup and better documentation of sync-all script

Rumor has it that sync-all is slowly on the way out. Now that all
subrepositories have been turned into git submodules, sync-all might
not be needed anymore. Nevertheless, here are some changes I had made
while trying to understand why it existed in the first place:

  • update comments + help text
  • rename some variables for maintainability
    • s/branch_name/remote_name/ origin is the name of a remote, not a branch
    • s/repo_base/remote_root/ the word *remote* is key here
    • s/defaultrepo/default_root/ this was a darcsism, and it doesn't refer to a repository but to the root directory of all repositories
  • small tweaks
  • .git can be a file nowadays
  • don't skip END actions on exceptions Trac #8886 reverts d523f9b3d4ce3463e8816cad2139ea397e00f8d1

Test Plan:
Why revert d523f9b3d4ce3463e8816cad2139ea397e00f8d1?

I put an old haddock repository from back in my tree. Now, when running
sync-all get, the following happens:

  1. I get a cryptic error saying:

    fatal: reference is not a tree: 5412c262f403e52be45d607b34eb3a5806ea2a76 Unable to checkout '5412c262f403e52be45d607b34eb3a5806ea2a76' in submodule path 'utils/haddock' git failed: 256 at ./sync-all line 112.
  1. sync-all checks if maybe an old haddock repository is present
  1. I get a clear warning saying:

    ============================ ATTENTION!

    You have an old haddock repository in your GHC tree!

    Please remove it (e.g. "rm -r utils/haddock"), and then run "./sync-all get" to get the new repository. ============================

Without commit d523f9b3d4ce3463e8816cad2139ea397e00f8d1 reverted, steps
2 and 3 were skipped. The problem that commit tried to solve,
is now solved with 7012ed8515100b4947383e93b82dbff7a0aa835c.

Reviewers: nomeata, austin, hvr

Reviewed By: austin, hvr

Subscribers: simonmar, ezyang, carter

Differential Revision:

GHC Trac Issues: Trac #8886, Trac #9212