git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* Feature-request: git-bundle --quiet
@ 2019-08-06 19:19 Robin H. Johnson
  2019-08-08 10:42 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Robin H. Johnson @ 2019-08-06 19:19 UTC (permalink / raw)
  To: Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 807 bytes --]

I started trying to make a stab at implementing this, but the code
wasn't standing out for it. Hopefully somebody else has poked at it
before:

I'd like to have a --quiet option for git-bundle, such that only errors
are sent to stderr, and not the packing progress.

This is towards a better incremental backup of large Git repos, later
steps would be easier selection of ranges (writing out markers e.g. to
use in the next day's incremental backup), and more fine-grained control
of the bundle repack behavior (e.g. don't try hard to repack, backup
speed is important)

-- 
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Treasurer
E-Mail   : robbat2@gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1113 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Feature-request: git-bundle --quiet
  2019-08-06 19:19 Feature-request: git-bundle --quiet Robin H. Johnson
@ 2019-08-08 10:42 ` Jeff King
  2019-08-12 10:15   ` Jacob Vosmaer
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2019-08-08 10:42 UTC (permalink / raw)
  To: Robin H. Johnson; +Cc: Git Mailing List

On Tue, Aug 06, 2019 at 07:19:11PM +0000, Robin H. Johnson wrote:

> I started trying to make a stab at implementing this, but the code
> wasn't standing out for it. Hopefully somebody else has poked at it
> before:
> 
> I'd like to have a --quiet option for git-bundle, such that only errors
> are sent to stderr, and not the packing progress.

This seems like a reasonable thing to want.

It looks like you'd have to teach cmd_bundle() to use parse_options(),
parse a quiet flag, and then pas that down to create_bundle(). Then it
would pass it along to write_pack_data(), which would decide whether to
pass "-q".

That would allow:

  git bundle --quiet create foo.bundle ...

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Feature-request: git-bundle --quiet
  2019-08-08 10:42 ` Jeff King
@ 2019-08-12 10:15   ` Jacob Vosmaer
  2019-08-12 16:08     ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Vosmaer @ 2019-08-12 10:15 UTC (permalink / raw)
  To: Git Mailing List

This is a tangent, but relevant: how do we feel about the fact that
'git bundle create' does not perform CRC32 checks when copying data
out of an existing packfile?

See https://github.com/git/git/blob/v2.22.0/builtin/pack-objects.c#L2614-L2622 .

I understand the rationale of "skip CRC32 when serving a fetch",
although I have no clue how much we gain from skipping it. But "pack
to stdout means fetch" isn't quite accurate, as it includes bundles.

Best regards,

Jacob Vosmaer
GitLab, Inc.

Best regards,

Jacob Vosmaer
GitLab, Inc.


On Thu, Aug 8, 2019 at 12:42 PM Jeff King <peff@peff.net> wrote:
>
> On Tue, Aug 06, 2019 at 07:19:11PM +0000, Robin H. Johnson wrote:
>
> > I started trying to make a stab at implementing this, but the code
> > wasn't standing out for it. Hopefully somebody else has poked at it
> > before:
> >
> > I'd like to have a --quiet option for git-bundle, such that only errors
> > are sent to stderr, and not the packing progress.
>
> This seems like a reasonable thing to want.
>
> It looks like you'd have to teach cmd_bundle() to use parse_options(),
> parse a quiet flag, and then pas that down to create_bundle(). Then it
> would pass it along to write_pack_data(), which would decide whether to
> pass "-q".
>
> That would allow:
>
>   git bundle --quiet create foo.bundle ...
>
> -Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Feature-request: git-bundle --quiet
  2019-08-12 10:15   ` Jacob Vosmaer
@ 2019-08-12 16:08     ` Jeff King
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff King @ 2019-08-12 16:08 UTC (permalink / raw)
  To: Jacob Vosmaer; +Cc: Git Mailing List

On Mon, Aug 12, 2019 at 12:15:19PM +0200, Jacob Vosmaer wrote:

> This is a tangent, but relevant: how do we feel about the fact that
> 'git bundle create' does not perform CRC32 checks when copying data
> out of an existing packfile?
> 
> See https://github.com/git/git/blob/v2.22.0/builtin/pack-objects.c#L2614-L2622 .
> 
> I understand the rationale of "skip CRC32 when serving a fetch",
> although I have no clue how much we gain from skipping it. But "pack
> to stdout means fetch" isn't quite accurate, as it includes bundles.

I don't recall it being discussed in the past. I think you could argue
either way:

  - a bundle is just another form of object transfer, like a fetch, and
    so we don't need to be careful about bitrot. The receiver would
    notice it when it indexes the pack (as opposed to an on-disk repack,
    where we'll immediately delete the old copy, and really want to make
    sure we haven't just lost data).

  - because a bundle isn't interactive like a regular fetch, any bit
    errors may not be seen until much later when somebody reads the. At
    that point it may not be possible to go back to the original repo
    (in the extreme case of using a bundle as a backup, it may have been
    deleted entirely!).

Depending on the cost of those checks (and I really doubt they are all
_that_ expensive), it might make sense for bundles to err on the
conservative side and do them. And if they are expensive, it should
perhaps be made an option for people who know they are planning to store
the bundle for a long time without reading it[1].

I agree that linking "skip CRC32" to "pack to stdout" is a bit hacky. It
should be easy to add a new --check-crc32 option which defaults to
"!pack_to_stdout" if not specified.

-Peff

[1] Of course bitrot in the original packfile is just one place this can
    go wrong. Depending how paranoid you want to be, it might be worth
    reading back the result before considering it a valid backup. That
    would catch some software bugs, as well as any bit corruption on the
    writing side. Doing a full index-pack is the most robust way there,
    but it's quite expensive. Just checking the SHA1 of the packfile
    itself would give pretty good protection against write errors,
    though you'd definitely want to couple it with CRC32 checks on the
    source (since Git would otherwise include the bad bits in its SHA1
    checksum).

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06 19:19 Feature-request: git-bundle --quiet Robin H. Johnson
2019-08-08 10:42 ` Jeff King
2019-08-12 10:15   ` Jacob Vosmaer
2019-08-12 16:08     ` Jeff King

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox