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

Re: -B option of git log

From
Jeff King <peff@peff.net>
Date
Feb 22, 2013, 00:57 UTC
Message-ID
<20130222005704.GA24287@sigill.intra.peff.net>
In-Reply-To
<5126BF50.6020500@gmx.net>
On Fri, Feb 22, 2013 at 01:44:00AM +0100, Eckhard Maass wrote:
Show 29 quoted lines
> Let me get a setup:
> 
> $> git init .
> Initialized empty Git repository in /tmp/t2/.git/
> $> echo 'Lorem ipsum doler sed. Lorem ipsum doler sed. Lorem ipsum doler
> sed. Lorem ipsum doler sed.' > a
> $> git add a
> $> git commit -m 'Init.'
> [master (root-commit) b78205c] Init.
>  1 file changed, 1 insertion(+)
>  create mode 100644 a
> $> mv a b
> $> echo 'new' > a
> $> git add -A .
> $> git commit -m '2nd.'
> [master a30ca49] 2nd.
>  2 files changed, 2 insertions(+), 1 deletion(-)
>  create mode 100644 b
> 
> Now, I get the following:
> 
> $> git log --oneline -B20%/80% -M20% --name-status
> a30ca49 2nd.
> M       a
> A       b
> b78205c Init.
> A       a
> 
> But I would expect that git-log shows me a rename from a to b and a new a.

I think the problem is that your test file is so tiny that it falls afoul of git's MINIMUM_BREAK_SIZE heuristic of 400 bytes (which prevents false positives on tiny files). Try replacing your "Lorem ipsum" echo with something like "seq 1 150", and I think you will find the result you are expecting.

-Peff
Previous: Eckhard MaassNext: Eckhard Maass
Message 2 of 3 in “-B option of git log”
  1. Eckhard MaassFeb 22, 2013
  2. Jeff KingFeb 22, 2013
  3. Eckhard MaassFeb 22, 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.