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

Re: [PATCH 1/1] fast-import: checkpoint: dump branches/tags/marks even if object_count==0

From
Adam Dinwoodie <adam@dinwoodie.org>
Date
Sep 28, 2017, 12:59 UTC
Message-ID
<20170928125916.GB9439@dinwoodie.org>
In-Reply-To
<5b6001e7db3c57fdd9e6354ed4294e2192524061.1506574951.git.e@nanocritical.com>
On Wed, Sep 27, 2017 at 10:07:41PM -0700, Eric Rannaud wrote:
Show 42 quoted lines
> The checkpoint command cycles packfiles if object_count != 0, a sensible
> test or there would be no pack files to write. Since 820b931012, the
> command also dumps branches, tags and marks, but still conditionally.
> However, it is possible for a command stream to modify refs or create
> marks without creating any new objects.
> 
> For example, reset a branch (and keep fast-import running):
> 
> 	$ git fast-import
> 	reset refs/heads/master
> 	from refs/heads/master^
> 
> 	checkpoint
> 
> but refs/heads/master remains unchanged.
> 
> Other example: a commit command that re-creates an object that already
> exists in the object database.
> 
> The man page also states that checkpoint "updates the refs" and that
> "placing a progress command immediately after a checkpoint will inform
> the reader when the checkpoint has been completed and it can safely
> access the refs that fast-import updated". This wasn't always true
> without this patch.
> 
> This fix unconditionally calls dump_{branches,tags,marks}() for all
> checkpoint commands. dump_branches() and dump_tags() are cheap to call
> in the case of a no-op.
> 
> Add tests to t9300 that observe the (non-packfiles) effects of
> checkpoint.
> 
> Signed-off-by: Eric Rannaud <e@nanocritical.com>
> ---
>  fast-import.c          |   6 +--
>  t/t9300-fast-import.sh | 126 +++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 129 insertions(+), 3 deletions(-)
> 
> 
> Updated to include Junio's latest remarks.
> 
> Also adding the necessary PIPE prereq, as pointed out by Ramsay Jones.

Cygwin doesn't have the PIPE prereq; I've just confirmed that the previous version of this patch has t9300 failing on Cygwin, but this version passes.

Previous: Eric RannaudNext: Eric Rannaud
Message 12 of 20 in “fast-import: checkpoint: dump branches/tags/marks even if object_count==0”
  1. fast-import: checkpoint: dump branches/tags/marks even if object_count==0Eric Rannaud, Sep 26, 2017
  2. Junio C HamanoSep 26, 2017
  3. 1/1 fast-import: checkpoint: dump branches/tags/marks even if object_count==0Eric Rannaud, Sep 26, 2017
  4. Junio C HamanoSep 27, 2017
  5. fast-import: checkpoint: dump branches/tags/marks even if object_count==0Eric Rannaud, Sep 27, 2017
  6. Ramsay JonesSep 27, 2017
  7. Junio C HamanoSep 28, 2017
  8. Eric RannaudSep 28, 2017
  9. 1/1 fast-import: checkpoint: dump branches/tags/marks even if object_count==0Eric Rannaud, Sep 28, 2017
  10. Junio C HamanoSep 28, 2017
  11. Eric RannaudSep 28, 2017
  12. Adam DinwoodieSep 28, 2017
  13. Eric RannaudSep 28, 2017
  14. Junio C HamanoSep 29, 2017
  15. fast-import: checkpoint: dump branches/tags/marks even if object_count==0Eric Rannaud, Sep 29, 2017
  16. Junio C HamanoSep 29, 2017
  17. Eric RannaudSep 29, 2017
  18. Junio C HamanoSep 29, 2017
  19. Junio C HamanoSep 28, 2017
  20. Eric RannaudSep 28, 2017

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.