login
Header Space

 
 

Re: [PATCH] prune: --expire=time

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: <git@...>
Date: Monday, January 22, 2007 - 1:17 am

Linus Torvalds <torvalds@osdl.org> writes:


I've been annoyed by those scary messages fsck-objects enough
and was wondering if we could make it less scary.  Especially
annoying is that the message about missing blobs and trees that
are only referred to by dangling commits.


I am still undecided which one should be the default.

For interactive use by developers who work in their own
repositories, git-prune is safe because nothing else would be
working on their repositories at the time.  While I do not think
we should recommend using git-gc from a cron job, if they want
to do so, giving an extra --no-prune option in their cron script
would be much less annoying.

-- >8 --
[PATCH] git-gc: do not run prune mindlessly.

You should pass --no-prune if you ever want to run git-gc from
a cron job.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 Documentation/git-gc.txt |   15 +++++++++++++--
 git-gc.sh                |   18 ++++++++++++++++--
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt
index 2bcc949..7b650a7 100644
--- a/Documentation/git-gc.txt
+++ b/Documentation/git-gc.txt
@@ -8,7 +8,7 @@ git-gc - Cleanup unnecessary files and optimize the local repository
 
 SYNOPSIS
 --------
-'git-gc'
+'git-gc' [--no-prune]
 
 DESCRIPTION
 -----------
@@ -21,6 +21,18 @@ Users are encouraged to run this task on a regular basis within
 each repository to maintain good disk space utilization and good
 operating performance.
 
+OPTIONS
+-------
+
+--no-prune::
+	Usually `git-gc` packs refs, expires old reflog entries,
+	packs loose objects, removes unreferenced loose objects,
+	and removes old 'rerere' records.  Among these, removal
+	of unreferenced loose objects is an unsafe operation
+	while other git operations are in progress.  This option
+	disables this unsafe step.
+
+
 Configuration
 -------------
 
@@ -50,7 +62,6 @@ kept.  This defaults to 15 days.
 
 See Also
 --------
-gitlink:git-prune[1]
 gitlink:git-reflog[1]
 gitlink:git-repack[1]
 gitlink:git-rerere[1]
diff --git a/git-gc.sh b/git-gc.sh
index 6de55f7..ecd4b0e 100755
--- a/git-gc.sh
+++ b/git-gc.sh
@@ -4,12 +4,26 @@
 #
 # Cleanup unreachable files and optimize the repository.
 
-USAGE=''
+USAGE='git-gc [--no-prune]'
 SUBDIRECTORY_OK=Yes
 . git-sh-setup
 
+no_prune=
+while case $# in 0) break ;; esac
+do
+	case "$1" in
+	--no-prune)
+		no_prune=:
+		;;
+	--)
+		usage
+		;;
+	esac
+	shift
+done
+
 git-pack-refs --prune &&
 git-reflog expire --all &&
 git-repack -a -d -l &&
-git-prune &&
+$no_prune git-prune &&
 git-rerere gc || exit
-- 
1.5.0.rc2


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] prune-packed: new option --min-age=N, Matthias Lederhofer, (Thu Jan 18, 1:18 pm)
Re: [PATCH] prune-packed: new option --min-age=N, Shawn O. Pearce, (Thu Jan 18, 1:24 pm)
Re: [PATCH] prune-packed: new option --min-age=N, Matthias Lederhofer, (Thu Jan 18, 1:42 pm)
Re: [PATCH] prune-packed: new option --min-age=N, Shawn O. Pearce, (Thu Jan 18, 1:51 pm)
[RFC] prune: --expire=seconds, Matthias Lederhofer, (Thu Jan 18, 6:29 pm)
Re: [RFC] prune: --expire=seconds, Junio C Hamano, (Thu Jan 18, 6:32 pm)
Re: [RFC] prune: --expire=seconds, Shawn O. Pearce, (Thu Jan 18, 11:44 pm)
[PATCH] prune: --expire=time, Matthias Lederhofer, (Fri Jan 19, 6:49 am)
Re: [PATCH] prune: --expire=time, Junio C Hamano, (Fri Jan 19, 3:18 pm)
Re: [PATCH] prune: --expire=time, Simon 'corecode' Schubert..., (Sat Jan 20, 8:06 am)
Re: [PATCH] prune: --expire=time, Matthias Lederhofer, (Sat Jan 20, 7:18 am)
Re: [PATCH] prune: --expire=time, Junio C Hamano, (Sun Jan 21, 2:55 am)
Re: [PATCH] prune: --expire=time, Matthias Lederhofer, (Sun Jan 21, 6:37 am)
Re: [PATCH] prune: --expire=time, Junio C Hamano, (Sun Jan 21, 7:17 am)
Re: [PATCH] prune: --expire=time, Jeff King, (Sun Jan 21, 6:01 pm)
Re: [PATCH] prune: --expire=time, Steven Grimm, (Sun Jan 21, 9:38 pm)
Re: [PATCH] prune: --expire=time, Junio C Hamano, (Sun Jan 21, 10:03 pm)
Re: [PATCH] prune: --expire=time, Jeff King, (Sun Jan 21, 9:52 pm)
Re: [PATCH] prune: --expire=time, Junio C Hamano, (Sun Jan 21, 10:06 pm)
Re: [PATCH] prune: --expire=time, Linus Torvalds, (Sun Jan 21, 10:23 pm)
Re: [PATCH] prune: --expire=time, Junio C Hamano, (Sun Jan 21, 10:40 pm)
[PATCH] v1.5.0.txt: update description of git-gc, Jeff King, (Sun Jan 21, 11:26 pm)
Re: [PATCH] prune: --expire=time, Linus Torvalds, (Sun Jan 21, 10:58 pm)
Re: [PATCH] prune: --expire=time, Junio C Hamano, (Mon Jan 22, 1:17 am)
Re: [PATCH] prune: --expire=time, Linus Torvalds, (Mon Jan 22, 2:26 am)
Re: [PATCH] prune: --expire=time, Junio C Hamano, (Mon Jan 22, 3:12 am)
Re: [PATCH] prune: --expire=time, Shawn O. Pearce, (Mon Jan 22, 2:57 am)
Re: [PATCH] prune: --expire=time, Shawn O. Pearce, (Sun Jan 21, 3:53 am)
Re: [PATCH] prune: --expire=time, Nicolas Pitre, (Fri Jan 19, 11:41 am)
speck-geostationary