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
AGAlexander Gladysh <agladysh-re5jqeeqqe8avxtiumwx3w@public.gmane.org>
Date
Sep 4, 2008, 14:54 UTC
Message-ID
<c6c947f60809040754g34e60633lcd5f872ac5e80158@mail.gmail.com>
In-Reply-To
<20080904143723.GB23708-o8xcbExO1WpAfugRpC6u6w@public.gmane.org>
(Shawn, apologies for double-posting.)
Show 13 quoted lines
> 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.

Aha! Thank you! That "--" is a comment in Lua (that is commented line that was removed in diff). First dash is from diff, next two came from file itself.

Steps to reproduce the bug:
$ mkdir test
$ cd test
$ git init
Initialized empty Git repository in path/test/.git/
$ cat >file.ext
-- 1
-- 2
-- 3
-- 4
-- 5
^D
$ git add file.ext
$ git commit -m "one"
Created initial commit 9226cdf: one
 1 files changed, 5 insertions(+), 0 deletions(-)
 create mode 100644 file.ext
$ cat >file.ext
-- 1
-- 2
-- 33
-- 4
-- 5
$ git gui
And stage (sole) hunk. You see the error.
Show 6 quoted lines
> 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?

Hopefully the above steps would help to debug this bug directly. If you still need any more info from me, please say, I'll be glad to provide it.

Thank you again! Alexander.

Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 5 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.