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

Re: Git blame only current branch

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 13, 2011, 17:25 UTC
Message-ID
<7vd3bswfhz.fsf@alter.siamese.dyndns.org>
In-Reply-To
<87y5ugsguj.fsf@gmail.com>
Vijay Lakshminarayanan <laksvij@gmail.com> writes:
> Before the introduction of the numeral 1, I am in complete agreement
> with you for the exact reasons you've mentioned above.  Post
> introduction of "l ? 1 : 0" it warrants a refactoring.

If your main point is that "return l ? 1 : 0;", then a better thing to do would be to use a well-known idiom to turn anything into a boolean, i.e.

	return !!l;

and your problem is solved without any renaming (we are not talking about any "refactoring" that changes code structure).

I've seen enough bikeshedding, so I'd stop after pointing you in the right direction by mentioning "git grep -e '<lst>'" and "git grep -e '<elem>'".

Previous: Frans Klaver
Message 10 of 10 in “Git blame only current branch”
  1. Stephen BashDec 12, 2011
  2. Jeff KingDec 12, 2011
  3. Stephen BashDec 12, 2011
  4. andreas.t.auer_gtml_37453@ursus.ath.cxDec 12, 2011
  5. Vijay LakshminarayananDec 13, 2011
  6. Jeff KingDec 13, 2011
  7. Junio C HamanoDec 13, 2011
  8. Vijay LakshminarayananDec 13, 2011
  9. Frans KlaverDec 13, 2011
  10. Junio C HamanoDec 13, 2011

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.