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

Re: [JGIT PATCH] Improve the sideband progress scaper to be more accurate

From
Nicolas Pitre <nico@cam.org>
Date
Jan 6, 2009, 20:55 UTC
Message-ID
<alpine.LFD.2.00.0901061546460.26118@xanadu.home>
In-Reply-To
<20090106192747.GD24578@spearce.org>
On Tue, 6 Jan 2009, Shawn O. Pearce wrote:
Show 26 quoted lines
> Nicolas Pitre <nico@cam.org> wrote:
> > There may indeed be line fragments sent over the sideband channel, as 
> > well as the opposite which is multiple lines sent at once in a single 
> > packet.  If you look at sideband.c you'll find about all those cases.
> 
> Thanks, that's what I thought...
>  
> > In general, what you have to do is:
> > 
> >  - for each packet:
> >    - split into multiple chunks on line breaks ('\r' or '\n')
> >    - for each chunk:
> >      - if last chunk didn't end with a line break, or if current 
> >        chunk is empty or only contains a line break, then skip printing 
> >        the "remote:" prefix.  Otherwise print it.
> >      - print the current chunk up to any line break
> >      - if current chunk contains a line break and other characters then
> >        print a sequence to clear the remaining of the screen line
> >      - print the line break if any
> 
> Hmm.  I should note that C Git still screws this up sometimes.  I've
> seen 1.6.1 git fetch mess up the output from repo.or.cz's sideband.
> I'm sure Pasky isn't running JGit's daemon, its too damn fast. :-)
> 
> I don't have a spew of it handy, but late last week I saw it screw
> up while doing a clone off repo.or.cz.
Next time you see such things please send me a snapshot.

What is still possible and IMHO not worth the effort to fix is some interaction between local and remote displays which, if intermixed in some unlucky way, do screw up the final appearance. For example, if the remote has sent a partial line, and before the remaining of it is received/printed you actually have some local process also displaying a line of its own. If that was to become a real issue, then the fix would involve caching any partial line sent from the remote until the associated line break is received.

Nicolas
Previous: Shawn O. Pearce
Message 13 of 13 in “Add jgit init, clone, receive-pack; transport fixes”
  1. 0/5 Add jgit init, clone, receive-pack; transport fixesShawn O. Pearce, Dec 23, 2008
  2. 1/5 Add "jgit receive-pack" and permit commands to start not in a repositoryShawn O. Pearce, Dec 23, 2008
  3. 2/5 Add "jgit init" command to create a new repositoryShawn O. Pearce, Dec 23, 2008
  4. 3/5 Modify "jgit daemon" so it can run outside of a repositoryShawn O. Pearce, Dec 23, 2008
  5. 4/5 Add "jgit clone" to support cloning off URLs that are JGit specificShawn O. Pearce, Dec 23, 2008
  6. 5/5 Fix "fetch pulled too many objects" when auto-following tagsShawn O. Pearce, Dec 23, 2008
  7. Robin RosenbergDec 31, 2008
  8. Shawn O. PearceDec 31, 2008
  9. Improve the sideband progress scaper to be more accurateShawn O. Pearce, Dec 31, 2008
  10. Robin RosenbergJan 3, 2009
  11. Nicolas PitreJan 6, 2009
  12. Shawn O. PearceJan 6, 2009
  13. Nicolas PitreJan 6, 2009

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.