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

Re: [RFC/PATCH] git-fetch: mega-terse fetch output

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 20, 2007, 06:58 UTC
Message-ID
<20071020065822.GW14735@spearce.org>
In-Reply-To
<20071020050019.GA27282@coredump.intra.peff.net>
Jeff King <peff@peff.net> wrote:
Show 14 quoted lines
> On Fri, Oct 19, 2007 at 10:14:59AM -0400, Nicolas Pitre wrote:
> 
> > > ==> git://repo.or.cz/git/spearce.git
> > >  * (new)              gitk -> spearce/gitk
> > >  * 1aa3d01..e7187e4   maint -> spearce/maint
> > >  * de61e42..7840ce6   master -> spearce/master
> > >  * 895be02..2fe5433   next -> spearce/next
> > >  + 89fa332...1e4c517  pu -> spearce/pu
> > >  * (new)              todo -> spearce/todo
> > 
> > Actually I think this is the best format so far: one line per branch, no 
> > terminal width issue (long branch names are simply wrapped), the 
> > old..new info is there also with the single character marker to quickly 
> > notice the type of update.
Yea, I think this is almost the right format.
Nicolas Pitre <nico@cam.org> wrote:
> Agreed.  ' ' = fast forward, '+' = forced update, and '!' = refused.
 
We're probably looking at something like this:
>From git://repo.or.cz/git/spearce.git
   1aa3d01..e7187e4   maint -> spearce/maint
   de61e42..7840ce6   master -> spearce/master
   895be02..2fe5433   next -> spearce/next
   (new)              todo -> spearce/todo
   (new)              tag v1.6.0
 + 89fa332...1e4c517  pu -> spearce/pu  (forced update)
 ! 2b5afb...289840    gitk -> spearce/gitk (non-fast forward)

Notice the sorting order by *type* of update. I think it makes the code slightly more complicated in builtin-fetch as we need to classify each ref into a type of update, then sort them by that type, but it allows the end-user to see the most "important" (not simple fast-forward updates) at the end of their terminal window, especially if there were many fast-forward branches. Within a class of update we still sort by ref name.

> Technically speaking, the hash IDs can be up to 80 characters long,
> since they are meant to be unique abbreviations. But in practice, I
> think leaving enough space for 10 + '...' + 10 should accomodate just
> about any project (IIRC, the kernel's longest non-unique is around 9).

Which nicely solves the issue with the window size as we aren't really worring about it here in this display.

-- 
Shawn.
Previous: Jeff KingNext: Karl Hasselström
Message 22 of 40 in “git-fetch: mega-terse fetch output”
  1. git-fetch: mega-terse fetch outputJeff King, Oct 19, 2007
  2. David SymondsOct 19, 2007
  3. Jeff KingOct 19, 2007
  4. Shawn O. PearceOct 19, 2007
  5. Jeff KingOct 19, 2007
  6. Shawn O. PearceOct 19, 2007
  7. Jeff KingOct 19, 2007
  8. Johannes SixtOct 19, 2007
  9. Santi BéjarOct 19, 2007
  10. Theodore TsoOct 19, 2007
  11. Johannes SixtOct 19, 2007
  12. Nicolas PitreOct 19, 2007
  13. Johannes SchindelinOct 19, 2007
  14. Santi BéjarOct 19, 2007
  15. Karl HasselströmOct 19, 2007
  16. Johannes SixtOct 19, 2007
  17. Nicolas PitreOct 19, 2007
  18. Johannes SchindelinOct 19, 2007
  19. Nicolas PitreOct 19, 2007
  20. Nicolas PitreOct 19, 2007
  21. Jeff KingOct 20, 2007
  22. Shawn O. PearceOct 20, 2007
  23. Karl HasselströmOct 19, 2007
  24. Nicolas PitreOct 19, 2007
  25. Theodore TsoOct 19, 2007
  26. Nicolas PitreOct 19, 2007
  27. Theodore TsoOct 19, 2007
  28. Nicolas PitreOct 19, 2007
  29. Miles BaderOct 23, 2007
  30. Andreas EricssonOct 19, 2007
  31. Andreas EricssonOct 19, 2007
  32. Nicolas PitreOct 19, 2007
  33. Steven GrimmOct 19, 2007
  34. Steven GrimmOct 19, 2007
  35. Nicolas PitreOct 19, 2007
  36. Sam RavnborgOct 19, 2007
  37. Nicolas PitreOct 19, 2007
  38. Andreas EricssonOct 19, 2007
  39. David KastrupOct 19, 2007
  40. Jeff KingOct 19, 2007

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.