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

Re: [PATCH w/signoff] pre-push.sample: Remove unwanted `IFS=' '`.

From
Jim Hill <gjthill@gmail.com>
Date
Dec 21, 2014, 19:12 UTC
Message-ID
<CAEE75_0Ff7NfQYUPrA414N9E0AE6LsS2zs0kL=BJ25bjPgom_w@mail.gmail.com>
In-Reply-To
<xmqqtx0obzwm.fsf@gitster.dls.corp.google.com>

I call it unwanted because the default works fine with the actual input and explicitly limiting whitespace this way breaks most command substitution. For instance, attempting to check only new commits with

    range="$local_sha $(
            git for-each-ref --format='^%(refname)' refs/remotes/$remote
    )"
    # ...
    commit=`git rev-list -n 1 --grep '\bbad string\b' $range`

fails, because the newlines are passed verbatim instead of being treated as whitespace.

See http://stackoverflow.com/a/27392839/1290731 for the motivation.
Sorry for the capsing, and also for presuming ESP.
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “pre-push.sample: Remove unwanted `IFS=' '`.”
  1. pre-push.sample: Remove unwanted `IFS=' '`.Jim Hill, Dec 21, 2014
  2. pre-push.sample: Remove unwanted `IFS=' '`.Jim Hill, Dec 21, 2014
  3. Junio C HamanoDec 21, 2014
  4. Jim HillDec 21, 2014
  5. Junio C HamanoDec 21, 2014
  6. Junio C HamanoDec 23, 2014
  7. pre-push.sample: remove unwanted `IFS=' '`.Jim Hill, Dec 21, 2014

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.