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 5, 2008, 05:20 UTC
Message-ID
<20080905052026.GB31166@spearce.org>
In-Reply-To
<7v63pbyxu9.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> 
> > git-gui was incorrectly parsing "--- foo" as the old file name
> > in the file header, causing it to generate a bad patch file when
> > the user tried to stage or unstage a hunk or the selected line.
> > We need to keep track of where we are in the parsing so that we do
> > not misread a deletion or addition record as part of the header.
> 
> While keeping track of state is obviously a good change, it also might be
> worth noticing "@@ -k,l +m,n @@" header and actively using the
> information.
Yea.  But that was a lot more work.

Noticing a hunk header, getting the line counts from it, then keeping a running counter to know how many lines before either EOF or the next header are all part of that hunk is just a lot of code I didn't feel like writing this evening. ;-)

-- 
Shawn.
Previous: Junio C HamanoNext: Johannes Sixt
Message 8 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.