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

Re: [RFC] Should "log --cc" imply "log --cc -p"?

From
Jeff King <peff@peff.net>
Date
Feb 5, 2013, 09:33 UTC
Message-ID
<20130205093307.GC24973@sigill.intra.peff.net>
In-Reply-To
<7vfw1c3ujo.fsf@alter.siamese.dyndns.org>
On Mon, Feb 04, 2013 at 08:36:43AM -0800, Junio C Hamano wrote:
Show 7 quoted lines
> "git log/diff-files -U8" do not need "-p" to enable textual patches,
> for example.  It is "I already told you that I want 8-line context.
> For what else, other than showing textual diff, do you think I told
> you that for?" and replacing "8-line context" with various other
> options that affect patch generation will give us a variety of end
> user complaints that would tell us that C) is more intuitive to
> them.

Yeah, I'd agree with this. My feeling is that when there are two options, A and B, and A is a no-op if B is not also specified, that it makes sense for A to imply B. We do it in several places already (and I just added some for "git branch --list" recently).

Is "--cc" a no-op when "-p" is not specified? Certainly "-c" is not, but I do not think you are proposing that. At first glance, "--cc" is nonsensical without "-p", but what about other xdiff callers? For example, in:

  git log --cc --stat

the "--cc" is significant. So I don't think it is right for "--cc" to always imply "-p". But if the rule kicked in only when no other format had been specified, that might make sense.

-Peff
Previous: Michael J GruberNext: Junio C Hamano
Message 5 of 10 in “[RFC] Should "log --cc" imply "log --cc -p"?”
  1. Junio C HamanoFeb 3, 2013
  2. Michael J GruberFeb 4, 2013
  3. Junio C HamanoFeb 4, 2013
  4. Michael J GruberFeb 5, 2013
  5. Jeff KingFeb 5, 2013
  6. Junio C HamanoFeb 5, 2013
  7. Ævar Arnfjörð BjarmasonFeb 5, 2013
  8. Jeff KingFeb 5, 2013
  9. Ævar Arnfjörð BjarmasonFeb 5, 2013
  10. Junio C HamanoFeb 5, 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.