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

Re: git diff --cc bug

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jun 16, 2008, 11:48 UTC
Message-ID
<48565311.9070407@viscovery.net>
In-Reply-To
<48510CFA.3060101@viscovery.net>
Johannes Sixt schrieb:
Show 24 quoted lines
> @@@ -635,31 -865,171 +641,169 @@@ void CValuesView::EraseVa...
>  -LRESULT CValuesView::OnOptionsChanged(WPARAM, LPARAM)
>  -{
>  -	if (GetDocument()->ShowPointerValues()) {
>  -		// invalidate values in the display
>  -		CPoint pt(m_x, m_y);	// will be erased
>  -		InvalidateValues();
>  -		FindFmtStrings();
>  -		Update(pt.x, pt.y);
>  -	}
>  -	return 0;
>  -}
>  -
>   void CValuesView::OnUpdate(CView* pSender, LPARAM lHint, ...
>   {
>   	switch (lHint) {
> ++<<<<<<< HEAD:SomUI/ValuesWnd.cpp
> ++=======
> + 	case UPDATE_MONITORFRAME:
> + 		{
> (hunk truncated for exposition)
> 
> Notice that there are no context lines at the beginning of the second
> hunk. I would not have expected this, and I think it's a bug in git diff.

Attached is a tar.gz of a repository the exposes the bug when a simple 'git diff' is run. If -U2 is added, the removals at the beginning of the hunk are not shown, as expected. If -U4 is added, more changes are shown at the beginning of the hunk, which happen to be separated by 3 lines of context from the part that is unexpectedly visible with -U3.

-- Hannes
Previous: Johannes SixtNext: Junio C Hamano
Message 2 of 4 in “git diff --cc bug”
  1. Johannes SixtJun 12, 2008
  2. Johannes SixtJun 16, 2008
  3. Junio C HamanoJun 19, 2008
  4. Johannes SixtJun 19, 2008

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.