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

Re: Git Gui does not want to work on chunk level

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 4, 2008, 14:37 UTC
Message-ID
<20080904143723.GB23708@spearce.org>
In-Reply-To
<c6c947f60809040220t589e65bfkbd693fd335792069@mail.gmail.com>
Alexander Gladysh <agladysh@gmail.com> wrote:
Show 14 quoted lines
> On Thu, Sep 4, 2008 at 3:08 AM, Shawn O. Pearce <spearce@spearce.org> wrote:
> >
> > Open up lib/diff.tcl and find "proc apply_hunk".  Inside of the
> > catch maybe insert a puts to see the diff, e.g.:
> > <...>
> 
> Header looks well-formed to me:
> 
> diff --git a/path/file.ext b/path/file.ext
> --- a/path/file.ext
> +++ b/path/file.ext
> 
> I have sent you full output privately. I do not see anything unusual
> in it... Anyplace where I may put more logging?

Actually the header you sent me privately wasn't well formed. It looked something like this:

  diff --git a/path/file.ext b/path/file.ext
  --- a/path/file.ext
  +++ b/path/file.ext
  --- assert(a != b)
  --- assert(a != c)
  @@ -10,1 +10,2 @@

It looks to me like some part of the context became part of the diff header, with three "-" stuck in front of it. Which git-apply then thinks is the pre-image path name.

Can you put in some more puts in that same section of the code so we can find out which of the puts has these extra asserts? Is it the first one for $current_diff_header or is it the second one that is supposed to be pulling in the patch hunk? Do you see these extra asserts in the diff viewer like this before you try to apply the patch?

-- 
Shawn.
Previous: Alexander GladyshNext: Alexander Gladysh
Message 4 of 15 in “Re: Git Gui does not want to work on chunk level”
  1. Alexander GladyshSep 3, 2008
  2. Shawn O. PearceSep 3, 2008
  3. Alexander GladyshSep 4, 2008
  4. Shawn O. PearceSep 4, 2008
  5. Alexander GladyshSep 4, 2008
  6. Shawn O. PearceSep 5, 2008
  7. Junio C HamanoSep 5, 2008
  8. Shawn O. PearceSep 5, 2008
  9. Johannes SixtSep 15, 2008
  10. Bert WesargNov 30, 2010
  11. Bert WesargNov 30, 2010
  12. Bert WesargDec 6, 2010
  13. Alexander GladyshSep 15, 2008
  14. Alexander GladyshSep 5, 2008
  15. Shawn O. PearceSep 15, 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.