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

Re: [PATCH] squash! diff: add --diff-line-prefix option for passing in a prefix

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 14, 2016, 20:42 UTC
Message-ID
<xmqqinv3krpe.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<5ca415f99718b1792cd0a9c31606b45d27befc48.1471164824.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> -	test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g')
> +	test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g' -e 'y/>/_/')

The existing sed scriptlet says "we cannot have slash and do not want to have space in filename, so we squash runs of them to a single underscore". If you have more characters that you do not want, you should add that to the existing set instead.

While you are at it, it may be sensible to add a colon to that set, too, no?

Something like this, perhaps?
> -	test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g')
> +	test=$(echo "$cmd" | sed -e 's|[/ <:>][/ <:>]*|_|g')
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 2 of 5 in “squash! diff: add --diff-line-prefix option for passing in a prefix”
  1. squash! diff: add --diff-line-prefix option for passing in a prefixJohannes Schindelin, Aug 14, 2016
  2. Junio C HamanoAug 14, 2016
  3. Johannes SchindelinAug 15, 2016
  4. Junio C HamanoAug 15, 2016
  5. Johannes SchindelinAug 16, 2016

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.