1 @title Repository Hints and Rewriting Commits
4 Dealing with rewrites of published repositories and other unusual problems.
9 Some repositories have unusual commits. You can provide "hints" to Phabricator
10 about these commits to improve behavior.
14 - **Rewritten Commits**: If you have rewritten the history of a published
15 repository, you can provide hints about the mapping from old commits to
16 new commits so it can redirect users who visit old pages to the proper
18 - **Unreadable Commits**: If some commits are not readable (which is rare,
19 but can happen in some cases if they are generated with an external tool)
20 you can provide hints so that Phabricator doesn't try to read them.
22 The remainder of this document explains how to create and remove hints, and how
23 to specify each type of hint.
28 To create hints, pipe a JSON list of hints to `bin/repository hint`:
31 phabricator/ $ cat hints.json | ./bin/repository hint
34 The hints should be a list of objects like this:
42 "old": "abcdef1234abcdef1234abcdef1234abcdef1234",
49 Each hint may have these keys:
51 - `repository`: A repository identifier (ID, PHID, callsign or short name).
52 - `hint`: The hint type, see below.
53 - `old`: The full identifier or commit hash of the commit you want to
55 - `new`: For hints which specify a new commit, the full identifier or commit
56 hash of the new commit.
58 See below for exactly how to specify each type of hint.
64 To remove a hint, create a hint of type `"none"`. This will remove any existing
67 For example, use a hint specification like this:
74 "old": "abcdef1234abcdef1234abcdef1234abcdef1234"
79 Phabricator won't treat commits without any hint specially.
82 Hint: Rewritten Commits
83 =======================
85 The `"rewritten"` hint allows you to redirect old commits to new commits after
86 a rewrite of published history. You should normally avoid rewriting published
87 commits, but sometimes this is necessary: for example, if a repository has
88 become unwieldy because it contains large binaries, you may strip them from
91 To provide this kind of hint, pass the `"old"` commit hash (from before the
92 rewrite) and the `"new"` commit hash (from after the rewrite).
94 For example, a hint might look like this:
101 "old": "abcdef1234abcdef1234abcdef1234abcdef1234",
102 "new": "098765ffaabbccdd4680098765ffaabbccdd4680"
107 Phabricator will show users that the commit was rewritten in the web UI.
110 Hint: Unreadable Commits
111 ========================
113 The `"unreadable"` hint allows you to tell Phabricator that it should not
114 bother trying to read the changes associated with a particular commit. In
115 some rare cases, repositories can contain commits which aren't readable
116 (for example, if they were created by external tools during an import or
119 To provide this kind of hint, pass the `"old"` commit which is affected.
121 For example, a hint might look like this:
127 "hint": "unreadable",
128 "old": "abcdef1234abcdef1234abcdef1234abcdef1234"
133 Phabricator won't try to read, parse, import, or display the changes associated