Обратитесь к git commit заголовком сообщения коммита - PullRequest
0 голосов
/ 27 августа 2018

Как я могу сослаться на git коммит по тексту / словам в заголовке его сообщения коммита?

Я хочу избежать:

  • Копирование / вставка мыши хэша коммита из git log
  • Ввод коммитов шестнадцатеричных цифр

1 Ответ

0 голосов
/ 27 августа 2018

TL; DR:

Ссылка на самый последний коммит, соответствующий <text>:

:/<text>, e.g. :/fix nasty bug

Ссылка на последний достижимый коммит из <rev>, который соответствует <text>

   <rev>^{/<text>}, e.g. HEAD^{/fix nasty bug}

Записи страницы руководства

man gitrevisions говорит:

Ссылка на последний достижимый коммит из <rev>, который соответствует <text>:

   <rev>^{/<text>}, e.g. HEAD^{/fix nasty bug}
       A suffix ^ to a revision parameter, followed by a brace pair that
       contains a text led by a slash, is the same as the :/fix nasty bug
       syntax below except that it returns the youngest matching commit
       which is reachable from the <rev> before ^.

Ссылка на самый последний коммит в любом месте, который соответствует <text>:

   :/<text>, e.g. :/fix nasty bug
       A colon, followed by a slash, followed by a text, names a commit
       whose commit message matches the specified regular expression. This
       name returns the youngest matching commit which is reachable from any
       ref. The regular expression can match any part of the commit message.
       To match messages starting with a string, one can use e.g.  :/^foo.
       The special sequence :/!  is reserved for modifiers to what is
       matched.  :/!-foo performs a negative match, while :/!!foo matches a
       literal !  character, followed by foo. Any other sequence beginning
       with :/!  is reserved for now. Depending on the given text, the
       shell’s word splitting rules might require additional quoting.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...