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

[BUG] Inconsistent output of git-show

From
GBGabriel Krisman Bertazi <krisman@suse.de>
Date
Nov 29, 2024, 19:36 UTC
Message-ID
<87jzclal3s.fsf@mailhost.krisman.be>
Hi,
1.  git show --oneline --no-patch
7af08b57bcb9 (HEAD, origin/master, linus/master) Merge tag 'trace-v6.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
2.  git show --oneline --no-patch | cat
7af08b57bcb9 Merge tag 'trace-v6.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
(--oneline doesn't matter here. Just making the output concise)

The branch information in parenthesis vanished just because of the shell redirection. That makes quickly writing shell one-liners very annoying. Sure, I can go figure a proper git invocation to get me that information. But we're all hardwired to use basic shell commands, and sometimes all I need is a quick grep and not learn a program-specific way of filtering.

So, could we make the output consistent regardless of redirection, i.e. What You See Is What You Pipe? Whoever requires a specific format for a script should be the ones using --format.

I've got v2.47.0 and I admit to not have tested later versions.
Thanks,
-- 
Gabriel Krisman Bertazi
Next: Kristoffer Haugsbakk
Message 1 of 2 in “[BUG] Inconsistent output of git-show”
  1. Gabriel Krisman BertaziNov 29, 2024
  2. Kristoffer HaugsbakkNov 29, 2024

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.