* Is there a way to control the number of revisions will be saved by git
@ 2008-12-03 11:01 Tzury Bar Yochay
2008-12-03 11:22 ` Johannes Sixt
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Tzury Bar Yochay @ 2008-12-03 11:01 UTC (permalink / raw)
To: git
Hello Happy Gitters,
Say I wish to save only 100 generations back (per branch).
Is it possible to configure git so it will save only N records back.
If git cannot be configured for that, Is there a way to shrink the repository
manually so it will contain the last N generations?
- Tzury
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is there a way to control the number of revisions will be saved by git
2008-12-03 11:01 Is there a way to control the number of revisions will be saved by git Tzury Bar Yochay
@ 2008-12-03 11:22 ` Johannes Sixt
2008-12-03 12:58 ` Jakub Narebski
2008-12-03 11:37 ` Arafangion
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Johannes Sixt @ 2008-12-03 11:22 UTC (permalink / raw)
To: Tzury Bar Yochay; +Cc: git
Tzury Bar Yochay schrieb:
> Hello Happy Gitters,
>
> Say I wish to save only 100 generations back (per branch).
> Is it possible to configure git so it will save only N records back.
No.
> If git cannot be configured for that, Is there a way to shrink the repository
> manually so it will contain the last N generations?
Yes:
$ git rev-parse HEAD~$N >> .git/info/grafts
$ git filter-branch HEAD
This assumes that your history is strictly linear and you do not have
tags. It also rewrites the $N commits so that they now have different
SHA1s. For this reason, don't share this repository with anyone - it leads
to confusion.
-- Hannes
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is there a way to control the number of revisions will be saved by git
2008-12-03 11:22 ` Johannes Sixt
@ 2008-12-03 12:58 ` Jakub Narebski
2008-12-03 13:40 ` Miklos Vajna
0 siblings, 1 reply; 9+ messages in thread
From: Jakub Narebski @ 2008-12-03 12:58 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Tzury Bar Yochay, git
Johannes Sixt <j.sixt@viscovery.net> writes:
> Tzury Bar Yochay schrieb:
> > Say I wish to save only 100 generations back (per branch).
> > Is it possible to configure git so it will save only N records back.
Why would you want that, by the way?
> No.
>
> > If git cannot be configured for that, Is there a way to shrink the
> > repository manually so it will contain the last N generations?
>
> Yes:
>
> $ git rev-parse HEAD~$N >> .git/info/grafts
> $ git filter-branch HEAD
>
> This assumes that your history is strictly linear and you do not have
> tags. It also rewrites the $N commits so that they now have different
> SHA1s. For this reason, don't share this repository with anyone - it leads
> to confusion.
Or just use shallow clone
git clone --depth <depth> <repository>
to have new copy (clone) of <repository> to have only <depth> commits
back. See man git-commit; but it might be not what you want.
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is there a way to control the number of revisions will be saved by git
2008-12-03 11:01 Is there a way to control the number of revisions will be saved by git Tzury Bar Yochay
2008-12-03 11:22 ` Johannes Sixt
@ 2008-12-03 11:37 ` Arafangion
2008-12-03 13:04 ` Jean-Luc Herren
2008-12-03 12:47 ` Tzury Bar Yochay
2008-12-03 18:20 ` Tzury Bar Yochay
3 siblings, 1 reply; 9+ messages in thread
From: Arafangion @ 2008-12-03 11:37 UTC (permalink / raw)
To: Tzury Bar Yochay; +Cc: git
On Wed, 2008-12-03 at 13:01 +0200, Tzury Bar Yochay wrote:
<snip>
> Say I wish to save only 100 generations back (per branch).
> Is it possible to configure git so it will save only N records back.
What would be the advantage in doing that? Git is designed so that you
have all your history available, and saves data in such a way that it
really doesn't take much space.
How would git be able to perform a merge from one branch to another if
it didn't have this history available?
That said, you could probably chop off the history you don't want by
doing tricks with grafting, and rewriting all your history, but this
would likely use more disk space because your branches wouldn't have
anything in common, and also make it very difficult to merge in the
future.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is there a way to control the number of revisions will be saved by git
2008-12-03 11:37 ` Arafangion
@ 2008-12-03 13:04 ` Jean-Luc Herren
0 siblings, 0 replies; 9+ messages in thread
From: Jean-Luc Herren @ 2008-12-03 13:04 UTC (permalink / raw)
To: Arafangion; +Cc: Tzury Bar Yochay, git
Arafangion wrote:
> On Wed, 2008-12-03 at 13:01 +0200, Tzury Bar Yochay wrote:
> <snip>
>> Say I wish to save only 100 generations back (per branch).
>> Is it possible to configure git so it will save only N records back.
>
> What would be the advantage in doing that?
That would be a shallow repository, as is already supported by
"git clone --depth 100". It can be useful for a number of things,
for example developing simple patches on top of HEAD and sending
them somewhere.
What the OP might want is a way to convert a full repository into
a shallow one (can be done by cloning and deleting the original),
and then be able to make it shallower from time to time, to limit
it to 100 revisions; not sure if that is possible.
jlh
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is there a way to control the number of revisions will be saved by git
2008-12-03 11:01 Is there a way to control the number of revisions will be saved by git Tzury Bar Yochay
2008-12-03 11:22 ` Johannes Sixt
2008-12-03 11:37 ` Arafangion
@ 2008-12-03 12:47 ` Tzury Bar Yochay
2008-12-03 18:20 ` Tzury Bar Yochay
3 siblings, 0 replies; 9+ messages in thread
From: Tzury Bar Yochay @ 2008-12-03 12:47 UTC (permalink / raw)
To: git
Thanks for your answers.
love git
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is there a way to control the number of revisions will be saved by git
2008-12-03 11:01 Is there a way to control the number of revisions will be saved by git Tzury Bar Yochay
` (2 preceding siblings ...)
2008-12-03 12:47 ` Tzury Bar Yochay
@ 2008-12-03 18:20 ` Tzury Bar Yochay
2008-12-03 18:23 ` Tzury Bar Yochay
3 siblings, 1 reply; 9+ messages in thread
From: Tzury Bar Yochay @ 2008-12-03 18:20 UTC (permalink / raw)
To: git
> Why would you want that, by the way?
I was thinking of building some experimental application on top of git
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Is there a way to control the number of revisions will be saved by git
2008-12-03 18:20 ` Tzury Bar Yochay
@ 2008-12-03 18:23 ` Tzury Bar Yochay
0 siblings, 0 replies; 9+ messages in thread
From: Tzury Bar Yochay @ 2008-12-03 18:23 UTC (permalink / raw)
To: git
On Wed, Dec 3, 2008 at 8:20 PM, Tzury Bar Yochay <tzury.by@gmail.com> wrote:
>> Why would you want that, by the way?
> I was thinking of building some experimental application on top of git
>
Looking at the numbers (of bytes). GIT's efficiency seems to redundant
this option which was a result of my concern about disk space usage.
GIT creators are magicians!
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-12-03 18:33 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-03 11:01 Is there a way to control the number of revisions will be saved by git Tzury Bar Yochay
2008-12-03 11:22 ` Johannes Sixt
2008-12-03 12:58 ` Jakub Narebski
2008-12-03 13:40 ` Miklos Vajna
2008-12-03 11:37 ` Arafangion
2008-12-03 13:04 ` Jean-Luc Herren
2008-12-03 12:47 ` Tzury Bar Yochay
2008-12-03 18:20 ` Tzury Bar Yochay
2008-12-03 18:23 ` Tzury Bar Yochay
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 NNTP newsgroup(s).