git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Add commands that git-gc runs underneath
@ 2007-08-30  9:35 Jari Aalto
  2007-08-30 10:08 ` Johannes Schindelin
  0 siblings, 1 reply; 13+ messages in thread
From: Jari Aalto @ 2007-08-30  9:35 UTC (permalink / raw
  To: git

git-gc is a higher level utility to "do the right thing". However
there are many other lower level utilities for the house keeping and
it is not clear what git-gc actually does. Adding the actual lower
level command and their parameters explain "what's going on".x

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
 Documentation/git-gc.txt |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
index c7742ca..c2315bf 100644
--- a/Documentation/git-gc.txt
+++ b/Documentation/git-gc.txt
@@ -21,6 +21,24 @@ Users are encouraged to run this task on a regular basis within
 each repository to maintain good disk space utilization and good
 operating performance.
 
+`git-gc` is a front-end to lower level house keeping commands and
+effectively runs these:
+
+--------------------------------
+ # for non-bare repositories only
+ git pack-refs --all --prune
+
+ git reflog expire --all
+
+ # with added --window -f parameters if --aggressive was specified
+ git repack -a -d -l
+
+ # if --prune was specified
+ git prune
+
+ git rerere gc
+--------------------------------
+
 OPTIONS
 -------
 
-- 
1.5.3.rc5



-- 
Welcome to FOSS revolution: we fix and modify until it shines

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-30  9:35 [PATCH] Add commands that git-gc runs underneath Jari Aalto
@ 2007-08-30 10:08 ` Johannes Schindelin
  2007-08-30 10:13   ` Andreas Ericsson
  2007-08-30 10:25   ` David Kastrup
  0 siblings, 2 replies; 13+ messages in thread
From: Johannes Schindelin @ 2007-08-30 10:08 UTC (permalink / raw
  To: Jari Aalto; +Cc: git

Hi,

On Thu, 30 Aug 2007, Jari Aalto wrote:

> git-gc is a higher level utility to "do the right thing". However there 
> are many other lower level utilities for the house keeping and it is not 
> clear what git-gc actually does. Adding the actual lower level command 
> and their parameters explain "what's going on".x

Isn't the whole purpose of git-gc to make it _unnecessary_ to know which 
lowlevel commands are run?

NACK.

Ciao,
Dscho

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-30 10:08 ` Johannes Schindelin
@ 2007-08-30 10:13   ` Andreas Ericsson
  2007-08-30 11:58     ` Johannes Schindelin
  2007-08-30 21:33     ` Junio C Hamano
  2007-08-30 10:25   ` David Kastrup
  1 sibling, 2 replies; 13+ messages in thread
From: Andreas Ericsson @ 2007-08-30 10:13 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: Jari Aalto, git

Johannes Schindelin wrote:
> Hi,
> 
> On Thu, 30 Aug 2007, Jari Aalto wrote:
> 
>> git-gc is a higher level utility to "do the right thing". However there 
>> are many other lower level utilities for the house keeping and it is not 
>> clear what git-gc actually does. Adding the actual lower level command 
>> and their parameters explain "what's going on".x
> 
> Isn't the whole purpose of git-gc to make it _unnecessary_ to know which 
> lowlevel commands are run?
> 
> NACK.
> 

I think of it as a handy way of doing all those tasks in the correct order
without having to remember more than a single command.

I kinda like it, and it might be helpful if someone's got a large repo and
one part of gc for some reason didn't complete so they want to start at
whatever step it broke off on.

When gc was a shell-script, it was fairly easy to find out the command-
sequence. Now it's a built-in and that deduction actually takes some
time and brainpower, so...

Acked-by: Andreas Ericsson <ae@op5.se>


-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-30 10:08 ` Johannes Schindelin
  2007-08-30 10:13   ` Andreas Ericsson
@ 2007-08-30 10:25   ` David Kastrup
  1 sibling, 0 replies; 13+ messages in thread
From: David Kastrup @ 2007-08-30 10:25 UTC (permalink / raw
  To: git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Thu, 30 Aug 2007, Jari Aalto wrote:
>
>> git-gc is a higher level utility to "do the right thing". However there 
>> are many other lower level utilities for the house keeping and it is not 
>> clear what git-gc actually does. Adding the actual lower level command 
>> and their parameters explain "what's going on".x
>
> Isn't the whole purpose of git-gc to make it _unnecessary_ to know which 
> lowlevel commands are run?

Unnecessary and undocumented are two different things.  I think it
very reasonable to document what exactly git-gc does and what it is
equivalent to.  So in principle,

Acked-by: David Kastrup <dak@gnu.org>

However, since this is detail information, it may be appropriate to
put this into a footnote and/or compress the copious number of empty
lines in it: that would better maintain the relation with the rest of
the entry.

-- 
David Kastrup

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-30 10:13   ` Andreas Ericsson
@ 2007-08-30 11:58     ` Johannes Schindelin
  2007-08-30 12:13       ` Andreas Ericsson
                         ` (2 more replies)
  2007-08-30 21:33     ` Junio C Hamano
  1 sibling, 3 replies; 13+ messages in thread
From: Johannes Schindelin @ 2007-08-30 11:58 UTC (permalink / raw
  To: Andreas Ericsson; +Cc: Jari Aalto, git

Hi,

On Thu, 30 Aug 2007, Andreas Ericsson wrote:

> I kinda like it [listing the commands git-gc calls], and it might be 
> helpful if someone's got a large repo and one part of gc for some reason 
> didn't complete so they want to start at whatever step it broke off on.

Let me clarify: I do not like the listing in the man page.  This suggests 
to the user to delve into plumbing areas where it is all too easy to shoot 
yourself in the foot.

I have nothing against listing the commands per se.  But the man page is 
too exposed IMHO.  (Or would you like to add the original shell script to 
git-log's man page, too?)

My preferred location would be somewhere near Documentation/technical/, so 
that people reading the commands are more likely to understand the 
consequences.

But maybe I'm wrong.

Ciao,
Dscho

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-30 11:58     ` Johannes Schindelin
@ 2007-08-30 12:13       ` Andreas Ericsson
  2007-08-30 12:15       ` Tom Clarke
  2007-08-30 12:34       ` Theodore Tso
  2 siblings, 0 replies; 13+ messages in thread
From: Andreas Ericsson @ 2007-08-30 12:13 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: Jari Aalto, git

Johannes Schindelin wrote:
> Hi,
> 
> On Thu, 30 Aug 2007, Andreas Ericsson wrote:
> 
>> I kinda like it [listing the commands git-gc calls], and it might be 
>> helpful if someone's got a large repo and one part of gc for some reason 
>> didn't complete so they want to start at whatever step it broke off on.
> 
> Let me clarify: I do not like the listing in the man page.  This suggests 
> to the user to delve into plumbing areas where it is all too easy to shoot 
> yourself in the foot.
> 

I misunderstood.

> I have nothing against listing the commands per se.  But the man page is 
> too exposed IMHO.  (Or would you like to add the original shell script to 
> git-log's man page, too?)
> 
> My preferred location would be somewhere near Documentation/technical/, so 
> that people reading the commands are more likely to understand the 
> consequences.
> 
> But maybe I'm wrong.
> 

Having read the reasoning, I confess myself convinced. Thanks for clarifying.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-30 11:58     ` Johannes Schindelin
  2007-08-30 12:13       ` Andreas Ericsson
@ 2007-08-30 12:15       ` Tom Clarke
  2007-08-30 12:34       ` Theodore Tso
  2 siblings, 0 replies; 13+ messages in thread
From: Tom Clarke @ 2007-08-30 12:15 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: Andreas Ericsson, Jari Aalto, git

On 8/30/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> I have nothing against listing the commands per se.  But the man page is
> too exposed IMHO.  (Or would you like to add the original shell script to
> git-log's man page, too?)

Perhaps the man pages for the lower level commands should reference
git-gc as the command that - unless you have special circumstances -
you probably want. As a new git user it was only reading this thread
that made me realise that git-gc is the command I want most of the
time - a number of the tutorials I had read referenced the low level
commands, and I didn't realise they had been superseded for normal
use.

-Tom

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-30 11:58     ` Johannes Schindelin
  2007-08-30 12:13       ` Andreas Ericsson
  2007-08-30 12:15       ` Tom Clarke
@ 2007-08-30 12:34       ` Theodore Tso
  2 siblings, 0 replies; 13+ messages in thread
From: Theodore Tso @ 2007-08-30 12:34 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: Andreas Ericsson, Jari Aalto, git

On Thu, Aug 30, 2007 at 12:58:00PM +0100, Johannes Schindelin wrote:
> On Thu, 30 Aug 2007, Andreas Ericsson wrote:
> 
> > I kinda like it [listing the commands git-gc calls], and it might be 
> > helpful if someone's got a large repo and one part of gc for some reason 
> > didn't complete so they want to start at whatever step it broke off on.
> 
> Let me clarify: I do not like the listing in the man page.  This suggests 
> to the user to delve into plumbing areas where it is all too easy to shoot 
> yourself in the foot.

I'm somewhat sympathetic to that argument, but at the same time, we're
still telling users to read the man page for plumbing areas in order
to understand to get the listing valid command-line options to git
commands.  In addition, the main git(1) man page is dedicating talking
about all sorts of low-level on-disk storage details that arguably
should be in the Documentation/technical that you suggested.  I also
don't quite see how commands like git-repack, git-prune,
git-pack-refs, et. al., are likely to get the user into trouble, any
more than git-gc --prune might.  Those commands are all relatively
safe, and indeed, they are all listed in the git-gc's "SEE ALSO"
section of its man page, so users are already being encouraged to
delve into plumbing areas.

That being said, given the SEE ALSO section, I don't think it adds a
huge amount of value to list the exact set of commands and options by
git-gc.  Also, if we add more functionality to git-gc in the future,
it would be pain to have to keep upgrading to man page uptodate.

   	    	    	    	 	      - Ted

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-30 10:13   ` Andreas Ericsson
  2007-08-30 11:58     ` Johannes Schindelin
@ 2007-08-30 21:33     ` Junio C Hamano
  2007-08-31  9:33       ` Andreas Ericsson
  1 sibling, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2007-08-30 21:33 UTC (permalink / raw
  To: Andreas Ericsson; +Cc: Johannes Schindelin, Jari Aalto, git

Andreas Ericsson <ae@op5.se> writes:

> When gc was a shell-script, it was fairly easy to find out the command-
> sequence...

Maybe referring more advanced/curious users to contrib/examples/
directory is a good idea, but not necessarily from manpages of
the commands that have been rewritten in C.

I think contrib/examples/ needs a README file that effectively
say "these are the last versions of shell script implementation
of the commands before they were rewritten in C.  New features
may have been added to the built-in ones but these example
scripts are not kept up to date.  They are here to serve as
examples to show you how you would pipeline the plumbing level
commands."

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-30 21:33     ` Junio C Hamano
@ 2007-08-31  9:33       ` Andreas Ericsson
  2007-08-31 19:25         ` David Kastrup
  2007-08-31 21:12         ` Junio C Hamano
  0 siblings, 2 replies; 13+ messages in thread
From: Andreas Ericsson @ 2007-08-31  9:33 UTC (permalink / raw
  To: Junio C Hamano; +Cc: Johannes Schindelin, Jari Aalto, git

Junio C Hamano wrote:
> Andreas Ericsson <ae@op5.se> writes:
> 
>> When gc was a shell-script, it was fairly easy to find out the command-
>> sequence...
> 
> Maybe referring more advanced/curious users to contrib/examples/
> directory is a good idea, but not necessarily from manpages of
> the commands that have been rewritten in C.
> 
> I think contrib/examples/ needs a README file that effectively
> say "these are the last versions of shell script implementation
> of the commands before they were rewritten in C.  New features
> may have been added to the built-in ones but these example
> scripts are not kept up to date.  They are here to serve as
> examples to show you how you would pipeline the plumbing level
> commands."
> 

Sensible, and also avoids the possible bitrot problem with the
man-page should there be additional actions added to standard
git-gc operations.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-31  9:33       ` Andreas Ericsson
@ 2007-08-31 19:25         ` David Kastrup
  2007-08-31 21:12         ` Junio C Hamano
  1 sibling, 0 replies; 13+ messages in thread
From: David Kastrup @ 2007-08-31 19:25 UTC (permalink / raw
  To: Andreas Ericsson; +Cc: Junio C Hamano, Johannes Schindelin, Jari Aalto, git

Andreas Ericsson <ae@op5.se> writes:

> Junio C Hamano wrote:
>> Andreas Ericsson <ae@op5.se> writes:
>>
>>> When gc was a shell-script, it was fairly easy to find out the command-
>>> sequence...
>>
>> Maybe referring more advanced/curious users to contrib/examples/
>> directory is a good idea, but not necessarily from manpages of
>> the commands that have been rewritten in C.
>>
>> I think contrib/examples/ needs a README file that effectively
>> say "these are the last versions of shell script implementation
>> of the commands before they were rewritten in C.  New features
>> may have been added to the built-in ones but these example
>> scripts are not kept up to date.  They are here to serve as
>> examples to show you how you would pipeline the plumbing level
>> commands."
>>
>
> Sensible, and also avoids the possible bitrot problem with the
> man-page should there be additional actions added to standard
> git-gc operations.

Let's just make all manual pages empty, and then we have solved all
manual page bitrot problems in one fell swoop.

Really: I don't see how this helps at all.  If I am interested in
seeing what operations git-gc performs, I am not interested in some
historical script's behavior.

Hiding that information into contrib/examples and telling people that
it may be wrong, anyway, is not really helpful as a way of documenting
git-gc's behavior.

Of _course_, _any_ useful documentation will have a "possible bitrot
problem with the man-page" whenever code is changed.  The solution is
not to make the manual pages as useless as possible so that nothing
can be subject to bitrot.  The solution is to update the information.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-31  9:33       ` Andreas Ericsson
  2007-08-31 19:25         ` David Kastrup
@ 2007-08-31 21:12         ` Junio C Hamano
  2007-08-31 21:27           ` David Kastrup
  1 sibling, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2007-08-31 21:12 UTC (permalink / raw
  To: Andreas Ericsson; +Cc: Johannes Schindelin, Jari Aalto, git

Andreas Ericsson <ae@op5.se> writes:

> Junio C Hamano wrote:
>> Andreas Ericsson <ae@op5.se> writes:
>>
>>> When gc was a shell-script, it was fairly easy to find out the command-
>>> sequence...
>>
>> Maybe referring more advanced/curious users to contrib/examples/
>> directory is a good idea, but not necessarily from manpages of
>> the commands that have been rewritten in C.
>>
>> I think contrib/examples/ needs a README file that effectively
>> say "these are the last versions of shell script implementation
>> of the commands before they were rewritten in C.  New features
>> may have been added to the built-in ones but these example
>> scripts are not kept up to date.  They are here to serve as
>> examples to show you how you would pipeline the plumbing level
>> commands."
>
> Sensible, and also avoids the possible bitrot problem with the
> man-page should there be additional actions added to standard
> git-gc operations.

Oh, I did not mean to address bit-rot issue.  I was addressing
"ah, in good old days we had tons of example scripts" issue.

If we want the manual to be explicit about what exactly happens
when you run "git-gc" (and I think we do), that needs to be done
independently.  But my feeling is that we do not want to
describe what happens solely in terms of what other individual
commands do.  Referring to other manual pages for more details
is fine, but that should not be the sole description.

In other words, instead of saying:

 - runs "git pack-refs", "git reflog expire --all", "git repack
   -a -d -l", ...

I think we would want to say it this way:

 * Under such-and-such condition, loose refs are packed for
   quicker access in $GIT_DIR/packed-refs file (runs "git
   pack-refs --prune");

 * Old reflog entries that record how tips of each branches were
   moved are expired (runs "git-reflog expire --all");

 * Packfiles are repacked along with loose object files, while
   exclusing objects that are available from the alternates
   (runs "git repack -a -d -l");

 * Unreferenced loose objects are removed if --prune is given
   (runs "git prune");
  
 * Old rerere records that record resolutions to previously
   conflicted merges are expired (runs "git rerere gc").

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

* Re: [PATCH] Add commands that git-gc runs underneath
  2007-08-31 21:12         ` Junio C Hamano
@ 2007-08-31 21:27           ` David Kastrup
  0 siblings, 0 replies; 13+ messages in thread
From: David Kastrup @ 2007-08-31 21:27 UTC (permalink / raw
  To: Junio C Hamano; +Cc: Andreas Ericsson, Johannes Schindelin, Jari Aalto, git

Junio C Hamano <gitster@pobox.com> writes:

> But my feeling is that we do not want to describe what happens
> solely in terms of what other individual commands do.  Referring to
> other manual pages for more details is fine, but that should not be
> the sole description.
>
> In other words, instead of saying:

[...]

> I think we would want to say it this way:

[...]

I would say your feeling is dead-on.  Full agreement with that
proposal.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

end of thread, other threads:[~2007-08-31 21:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-30  9:35 [PATCH] Add commands that git-gc runs underneath Jari Aalto
2007-08-30 10:08 ` Johannes Schindelin
2007-08-30 10:13   ` Andreas Ericsson
2007-08-30 11:58     ` Johannes Schindelin
2007-08-30 12:13       ` Andreas Ericsson
2007-08-30 12:15       ` Tom Clarke
2007-08-30 12:34       ` Theodore Tso
2007-08-30 21:33     ` Junio C Hamano
2007-08-31  9:33       ` Andreas Ericsson
2007-08-31 19:25         ` David Kastrup
2007-08-31 21:12         ` Junio C Hamano
2007-08-31 21:27           ` David Kastrup
2007-08-30 10:25   ` David Kastrup

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).