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

Re: [PATCH 2/3] git-bundle: die if a given ref is not included in bundle

From
Mark Levedahl <mlevedahl@gmail.com>
Date
Mar 9, 2007, 15:36 UTC
Message-ID
<45F17EF0.5060008@gmail.com>
In-Reply-To
<7vejny7umx.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 7 quoted lines
> If I were doing a nightly script, I would probably be doing
> something like this:
>
> 	#!/bin/sh
> 	yesterday=$(git bundle list-heads yesterday.bdl | sed -e 's/ .*//')
> 	git bundle create today.bdl --all --not $yesterday
> 	# mail it out

Thinking about this further, the above has a problem (or should, but see below). Consider a case where master is not updated since yesterday. Effectively, the above becomes

git bundle create today.bdl  master <other-refs> --not master <other-refs>

As ref master is excluded, the bundle creation should die because master cannot be included. Experimenting with next (299fcfbdcb5afd85) however, I get:

git>git bundle create t.bdl master --not master Generating pack... Done counting 0 objects. Writing 0 objects. Total 0 (delta 0), reused 0 (delta 0) git>git ls-remote t.bdl git>

e.g, an empty bundle is created without any error or warning. This is the one case I believe an error should result: there is no use to sending (or even creating) an empty bundle.

As a date limited bundle containing all updated refs is my basic use, I really want this case to not be hard, and it definitely should not require externally maintained history or scripting to create. Absent the "die if any ref wasn't updated in the given date range" logic, and adding always die if the resulting bundle is empty, git bundle in next accomplishes what I want.

Mark
Previous: Mark LevedahlNext: Johannes Schindelin
Message 5 of 21 in “git-bundle: die if a given ref is not included in bundle”
  1. 2/3 git-bundle: die if a given ref is not included in bundleJohannes Schindelin, Mar 9, 2007
  2. Mark LevedahlMar 9, 2007
  3. Junio C HamanoMar 9, 2007
  4. Mark LevedahlMar 9, 2007
  5. Mark LevedahlMar 9, 2007
  6. git-bundle: only die if pack would be empty, warn if ref is skippedJohannes Schindelin, Mar 9, 2007
  7. Mark LevedahlMar 10, 2007
  8. Junio C HamanoMar 9, 2007
  9. Mark LevedahlMar 10, 2007
  10. Johannes SchindelinMar 10, 2007
  11. Mark LevedahlMar 10, 2007
  12. Johannes SchindelinMar 10, 2007
  13. Mark LevedahlMar 10, 2007
  14. Johannes SchindelinMar 11, 2007
  15. Junio C HamanoMar 11, 2007
  16. Johannes SchindelinMar 11, 2007
  17. Mark LevedahlMar 11, 2007
  18. Junio C HamanoMar 11, 2007
  19. Johannes SchindelinMar 11, 2007
  20. Mark LevedahlMar 13, 2007
  21. git-bundle: die if the bundle is empty.Mark Levedahl, Mar 9, 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.