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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Sunday, January 21, 2007 - 4:17 am

Matthias Lederhofer <matled@gmx.net> writes:


Although I've merged this and pushed out v1.5.0-rc2, I am
starting to think this whole implementation of grace period is
unfortunately busted and does not buy us much.  Running
git-prune in an uncontrolled way from a cron job is still not
safe.

Suppose there is a repository that has one old blob that is not
referenced from any existing ref (in other words, its been more
than the grace period since 'prune' was run in the repository,
and one of its heads were rewound which lost the last reference
to the blob).  You are pushing a new commit into it, whose tree
has that blob as one of the files.

You construct a pack, and unpack-objects starts to run to
extract the objects you send in the said repository.  The pack
you are sending does contain the blob (because no refs reached
it in the repository), but unpack-objects safety measure means
the blob is not re-extracted to overwrite the existing old blob.

Now, an automated prune runs and finishes reading the available
refs before your push concludes and updates the ref with your
new commit.

What happens?

If we wanted to apply this grace period conservatively,
protecting young objects is not enough.  You need to protect
everything they refer to as well.  In the above scenario, you
would protect the new commit object and probably the tree
objects contained within, but the code happily will lose the
blob that was already sitting there.

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