[systemd-devel] Messed up PR references on Github

Daniel Mack daniel at zonque.org
Wed Jun 10 10:10:23 PDT 2015


On 06/10/2015 07:04 PM, Filipe Brandenburger wrote:
> On Wed, Jun 10, 2015 at 12:23 AM, Jan Synáček <jsynacek at redhat.com> wrote:
>> See https://github.com/systemd/systemd/pull/5. There are multiple
>> references to this PR that say "<user> referenced this pull request from
>> a commit in <commit>", which is hilarious, as those clearly are not
>> references to this PR. Their commit messages contain the string "#5" and
>> Github thinks it means a reference. I'm pretty sure this will mess up a
>> lot of pull requests in the future. Is there a way to fix this?
> 
> If you learn one thing about Markdown (or GitHub Markdown), learn that
> a block delimited by ``` lines makes it a verbatim literal (think
> <pre> in HTML terms), so when pasting output the best is:
> 
> ```
> #1 bla bla bla
> #2 yada yada
> ```
> 
> That won't expand the #n references or any other GitHub syntax...
> 
> There's always the "Preview" tab which is useful to look before
> submitting the comment as well...
> 
> And I think you can always edit your comments after you posted them
> (not sure if that will undo the link between the two PRs though.)

The problem is that in this particular case, the # lines were in the
actual commit log, not in a fancy Markdown enabled input field that you
use for commenting. That commit was simply pushed to a forked repo
afterwards, and GitHub applied its magic to what it found in the history.

We can't ask people to take special care in their commit logs in order
to prevent that, because really, this is an implementation detail of GitHub.



Daniel



More information about the systemd-devel mailing list