all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: schwab@suse.de, stephen.berman@gmx.net, sven.axelsson@gmail.com,
	angelo.graziosi@alice.it, emacs-devel@gnu.org
Subject: Re: Move to git is imminent - awaiting Stefan's approval
Date: Wed, 08 Jan 2014 17:23:58 +0200	[thread overview]
Message-ID: <83eh4ifqep.fsf@gnu.org> (raw)
In-Reply-To: <87k3ebgmni.fsf@uwakimon.sk.tsukuba.ac.jp>

> From: "Stephen J. Turnbull" <stephen@xemacs.org>
> Cc: schwab@suse.de,
>     stephen.berman@gmx.net,
>     emacs-devel@gnu.org,
>     sven.axelsson@gmail.com,
>     angelo.graziosi@alice.it
> Date: Wed, 08 Jan 2014 12:47:29 +0900
> 
> Eli Zaretskii writes:
>  > I did read the documentation.  The docs of gc mentions git-repack, so
>  > I thought the former runs the latter.  What part did I miss?
> 
> The fact that the documentation clearly puts conditions on when git-gc
> runs git-repack.

I wouldn't qualify the gc manpage as "clear" on this matter, see
below.  But given what it does say, I _guessed_ that "git gc" _might_
run git-repack, and asked whether that wasn't so.  Why that pissed you
off I don't know.  You seem to have deduced a different conclusion,
but IMO that's just one more evidence that the man page is not really
clear on this matter.

>  > And how was I supposed to know from this whether git-repack will or
>  > won't be run, what with the word "repack" explicitly in this text (and
>  > in other parts of that man page)?
> 
> Huh?  If there's a condition on whether it runs, then presumably
> sometimes it doesn't run.

AFAIU, you refer to this part of your previous message:

> Specifically, according to the help, git-gc removes garbage (in the
> usual sense of a tracing collector) and "compresses" (ie, packs) loose
> objects using delta compression (and then the result is deflated as
> with loose objects, I believe).  It will repack the packs into *one*
> pack (presumably with better delta compression) if the number of packs
> is greater than the value of gc.autopacklimit (in .git/config;
> default: 50).

However, this comes from the part in the man page that describes the
"--auto" option to gc.  I didn't use and didn't mean to use that
option, so the above is not necessarily relevant to "git gc".

But even if this description is relevant when --auto is not used,
the above says that repacking will sometimes happen.

As to what happens regardless of any options, the man page says just
this:

  DESCRIPTION

    Runs a number of housekeeping tasks within the current repository,
    such as compressing file revisions (to reduce disk space and
    increase performance) and removing unreachable objects which may
    have been created from prior invocations of git add.

This says "such as", which doesn't imply an exhaustive list of tasks.
Moreover, it never says that "compressing file revisions" and
"removing unreachable objects" is not done by git-repack.  So the
above description does not contradict my conclusion, and definitely
doesn't present exact description of the conditions under which gc
will run repack.  Perhaps if I knew exactly what repack does, I could
have filled the voids, but I don't.

Finally, the "Configuration" section has this, among the rest:

  The optional configuration variable gc.packrefs determines if git gc
  runs git pack-refs. This can be set to "notbare" to enable it within
  all non-bare repos or it can be set to a boolean value. This
  defaults to true.

  The optional configuration variable gc.aggressiveWindow controls how
  much time is spent optimizing the delta compression of the objects
  in the repository when the --aggressive option is specified. The
  larger the value, the more time is spent optimizing the delta
  compression. See the documentation for the --window' option in
  git-repack(1) for more details. This defaults to 250.

Both of these configuration settings explicitly mention packing and/or
repacking.  Again, without knowing exactly what repack does, there's
no clarity here whether pack-refs is related to repack in any way,
shape or form (looking in the sources resolves this, see below).

Given these hints, IMO it was a reasonable guess that gc does run
repack at least under some conditions, when --auto is not used.  Since
these conditions are not defined completely by the man page, it was my
guess that gc, with or without the --aggressive option, might run
repack.  As it turns out, the second part is surely true.

> You read the source?  I find that hard to believe.

I didn't read the source in this case, only the documentation.

I don't understand the "hard to believe" part, though: I do have the
git's git repo on my disk, and you could easily imagine that I'm not
new to reading sources.

Having now looked in the sources, this is what I see:

	if (pack_refs && run_command_v_opt(pack_refs_cmd.argv, RUN_GIT_CMD))
		return error(FAILED_RUN, pack_refs_cmd.argv[0]);

	if (run_command_v_opt(reflog.argv, RUN_GIT_CMD))
		return error(FAILED_RUN, reflog.argv[0]);

	if (run_command_v_opt(repack.argv, RUN_GIT_CMD))
		return error(FAILED_RUN, repack.argv[0]);

	if (prune_expire) {
		argv_array_push(&prune, prune_expire);
		if (quiet)
			argv_array_push(&prune, "--no-progress");
		if (run_command_v_opt(prune.argv, RUN_GIT_CMD))
			return error(FAILED_RUN, prune.argv[0]);
	}

	if (run_command_v_opt(rerere.argv, RUN_GIT_CMD))
		return error(FAILED_RUN, rerere.argv[0]);

My reading of this is that "git gc" runs, in sequence, pack-refs
(conditioned on gc.packrefs), reflog, repack, prune (conditioned on
the --prune option), and finally rerere.  IOW, "git gc" does run
repack.  The only difference between --aggressive and non-aggressive
modes is here:

	if (aggressive) {
		argv_array_push(&repack, "-f");
		argv_array_push(&repack, "--depth=250");
		if (aggressive_window > 0)
			argv_array_pushf(&repack, "--window=%d", aggressive_window);
	}

That is, --aggressive just passes the -f switch to git-repack, which
tells it not to reuse deltas (i.e. recompute them anew, AFAIU).

> (The doc for --aggressive says nothing about repack, only that it
> optimizes harder.)

See above: the description of aggressiveWindow setting quite clearly
says that --aggressive does run repack.  And in fact it does, indeed.

> > Stephen can now be pissed off by himself.
> 
> Yup.  And I won't waste time on suppressing my irritation while
> helping with GitForEmacsDevs

Too bad.



  reply	other threads:[~2014-01-08 15:23 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06 22:14 Move to git is imminent - awaiting Stefan's approval Angelo Graziosi
2014-01-06 22:57 ` David Kastrup
2014-01-11 22:34   ` Nix
2014-01-06 23:01 ` Andreas Schwab
2014-01-07 10:24   ` Angelo Graziosi
2014-01-07 10:37     ` Git tips for Emacs development (was Re: Move to git is imminent - awaiting Stefan's approval) Nic Ferrier
2014-01-07 16:05       ` Eli Zaretskii
2014-01-07 12:27     ` Move to git is imminent - awaiting Stefan's approval Sven Axelsson
2014-01-07 14:41       ` Stephen Berman
2014-01-07 14:57         ` Andreas Schwab
2014-01-07 15:05           ` Stephen Berman
2014-01-07 16:25           ` Eli Zaretskii
2014-01-07 16:35             ` Andreas Schwab
2014-01-07 16:37               ` Angelo Graziosi
2014-01-07 16:41                 ` Andreas Schwab
2014-01-07 17:08                   ` Eli Zaretskii
2014-01-07 17:23                     ` Óscar Fuentes
2014-01-07 17:56                       ` Eli Zaretskii
2014-01-07 17:24                     ` Stephen J. Turnbull
2014-01-07 18:05                       ` Eli Zaretskii
2014-01-07 18:17                         ` Sven Axelsson
2014-01-07 18:49                           ` Stephen J. Turnbull
2014-01-07 19:06                             ` Eli Zaretskii
2014-01-08  3:47                               ` Stephen J. Turnbull
2014-01-08 15:23                                 ` Eli Zaretskii [this message]
2014-01-07 18:02                     ` Thien-Thi Nguyen
2014-01-07 18:06                       ` Sven Axelsson
2014-01-07 18:47                         ` Andreas Schwab
2014-01-07 19:07                           ` Sven Axelsson
2014-01-07 19:16                             ` Eli Zaretskii
2014-01-08  3:52                               ` Stephen J. Turnbull
2014-01-07 20:08                     ` Angelo Graziosi
2014-01-08 17:32                       ` Eli Zaretskii
2014-01-08 18:34                         ` Andreas Schwab
2014-01-08 18:42                           ` Eli Zaretskii
2014-01-08 21:59                             ` Angelo Graziosi
2014-01-09  0:05                               ` Stefan Monnier
2014-01-09  6:35                                 ` Eli Zaretskii
2014-01-12  6:27                           ` Bob Proulx
2014-01-12 10:11                             ` Andreas Schwab
2014-01-12 16:11                               ` Eli Zaretskii
2014-01-12 17:09                                 ` Andreas Schwab
2014-01-12 17:41                                   ` Eli Zaretskii
2014-01-12 21:13                               ` Bob Proulx
2014-01-12 21:24                                 ` Andreas Schwab
2014-01-13  3:07                                   ` Bob Proulx
2014-01-15  5:15                                 ` Bob Proulx
2014-01-12 10:29                             ` Achim Gratz
2014-01-12 21:29                               ` Bob Proulx
2014-01-12 16:07                             ` Eli Zaretskii
2014-01-08 21:55                         ` Angelo Graziosi
2014-01-09 19:44                           ` Eli Zaretskii
2014-01-07 15:00         ` Angelo Graziosi
2014-01-07 16:17       ` Eli Zaretskii
2014-01-10  6:40       ` Antonio Nikishaev
2014-01-07 12:29     ` David Kastrup
2014-01-07 16:11     ` Eli Zaretskii
2014-01-07 13:37   ` Angelo Graziosi
2014-01-07 14:24     ` Andreas Schwab
2014-01-09 12:18       ` Angelo Graziosi
2014-01-07 16:14   ` Eli Zaretskii
2014-01-07 17:38     ` Rüdiger Sonderfeld
     [not found] <<20140106165108.B6BF4380865@snark.thyrsus.com>
     [not found] ` <<83zjn9rpaz.fsf@gnu.org>
2014-01-06 17:41   ` Drew Adams
2014-01-06 17:46     ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2014-01-06 16:51 Eric S. Raymond
2014-01-06 17:20 ` Jay Belanger
2014-01-06 19:40   ` Eric S. Raymond
2014-01-07 15:57     ` Jay Belanger
2014-01-07 11:20   ` Stephen J. Turnbull
2014-01-07 11:26     ` Eric S. Raymond
2014-01-06 17:30 ` Eli Zaretskii
2014-01-06 21:09   ` Stefan Monnier
2014-01-06 21:29     ` Óscar Fuentes
2014-01-06 23:57       ` Stefan Monnier
2014-01-07  0:17     ` Leo Liu
2014-01-07  5:24     ` Thierry Volpiatto
2014-01-07 13:45       ` Stefan Monnier
2014-01-07 16:22         ` Eli Zaretskii
2014-01-08 21:12     ` Barry Warsaw
2014-01-09  0:04       ` Stefan Monnier
2014-01-09  6:32         ` Eli Zaretskii
2014-01-09  7:32           ` David Engster
2014-01-09  9:46           ` Juanma Barranquero
2014-01-06 17:40 ` Juanma Barranquero
2014-01-06 18:42   ` Bastien
2014-01-06 19:06     ` Jarek Czekalski
2014-01-06 19:37   ` Drew Adams
2014-01-06 19:42   ` Eric S. Raymond
2014-01-06 19:51     ` Drew Adams
2014-01-06 20:25       ` Eric S. Raymond
2014-01-06 20:28     ` Juanma Barranquero
2014-01-07 11:24     ` Stephen J. Turnbull
2014-01-07  2:48 ` joakim
2014-01-07 10:03   ` Andreas Schwab
2014-01-07 10:08     ` joakim
2014-01-15 17:23 ` Martin Geisler
2014-01-15 18:39   ` Stefan Monnier
2014-01-15 22:57     ` Martin Geisler
2014-01-15 23:53       ` Stefan Monnier
2014-01-16 12:25       ` Rüdiger Sonderfeld
2014-01-16  1:40   ` Yuri Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83eh4ifqep.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=angelo.graziosi@alice.it \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@suse.de \
    --cc=stephen.berman@gmx.net \
    --cc=stephen@xemacs.org \
    --cc=sven.axelsson@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.