git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC 1/4] contrib: add git-contacts helper

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 1, 2013, 19:17 UTC
Message-ID
<7vy59qf5to.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vbo6mgm5e.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 11 quoted lines
>  - If the patch were prepared with a non-standard src/dst-prefix,
>    unconditional substr($1, 2) would call blame on a wrong (and
>    likely to be nonexistent) path without a useful diagnosis (the
>    invocation of "git blame" will likely die with "no such path
>    'tailofpathname' in $id").
>
>    One way to make it more robust may be to do something like this:
>
> 	if (/^--- /) {
> 		if (m{^--- (?:a/(.*)|/dev/null)$}) {
> 			$source = ($1 eq '/dev/null') ? undef : $1;

Typo/thinko. I did that (?:(foo)|bar) thing so that I do not have to do the conditional. The above can just be

 		if (m{^--- (?:a/(.*)|/dev/null)$}) {
 			$source = $1;
Previous: Junio C HamanoNext: Eric Sunshine
Message 4 of 15 in “Perl rewrite of Ruby git-related”
  1. 0/4 Perl rewrite of Ruby git-relatedEric Sunshine, Jun 30, 2013
  2. 1/4 contrib: add git-contacts helperEric Sunshine, Jun 30, 2013
  3. Junio C HamanoJul 1, 2013
  4. Junio C HamanoJul 1, 2013
  5. Eric SunshineJul 2, 2013
  6. Junio C HamanoJul 2, 2013
  7. Eric SunshineJul 2, 2013
  8. 2/4 contrib: contacts: add support for multiple patchesEric Sunshine, Jun 30, 2013
  9. Junio C HamanoJul 1, 2013
  10. Junio C HamanoJul 1, 2013
  11. Eric SunshineJul 2, 2013
  12. 3/4 contrib: contacts: add ability to parse from committishEric Sunshine, Jun 30, 2013
  13. 4/4 contrib: contacts: interpret committish akin to format-patchEric Sunshine, Jun 30, 2013
  14. Junio C HamanoJul 1, 2013
  15. Eric SunshineJul 2, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.