git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Seth Robertson <in-gitvger@baka.org>
Cc: Yuval Adam <yuv.adm@gmail.com>, git@vger.kernel.org
Subject: Re: Maintaining historical data in a git repo
Date: Fri, 30 Mar 2012 09:32:51 -0700 (PDT)	[thread overview]
Message-ID: <m3boneaw27.fsf@localhost.localdomain> (raw)
In-Reply-To: <201203301618.q2UGIF3Q005388@no.baka.org>

Seth Robertson <in-gitvger@baka.org> writes:

> In message <CA+P+rLcWT0SZQjW2LtFXXCDRwjMp8daJ2hVup=7cnsRGbKw7xw@mail.gmail.com>, Yuval Adam writes:
> 
>     On Fri, Mar 30, 2012 at 6:10 PM, Seth Robertson <in-gitvger@baka.org> wrote:
>     > Revision control shouldn't be used to change the past (even if git
>     > allows this with sufficient amounts of pain/warning to all users).
>     > What it is extremely good at is preserving the past and tracking the
>     > changes that are made.
> 
>     This is exactly what we _do_ want to do.
> 
>     Is this something that is definitively complicated with git?
> 
> Ah, I understand now.  I imagine others will chime in as well, but
> this should not be too complex with git.  You can easily go back into
> history and change it.  The problem comes in when you have shared your
> repository with other people.
> 
> In general, rewriting public history is a bad idea because git cannot
> tell the difference between someone adding to history for good reasons
> (expanding on known history) and bad reasons (retroactively rewriting
> the law to add a loophole).
> 
> You can absolutely do it, 

For example using `git filter-branch`, or grafts mechanism plus said
git-filter-branch, or interactive rebase for changes closer to current
version, or `git commit --amend` for latest version (latest commit).

>                           but then you have to "force push" your
> changes to the master server to override the history (assuming that is
> allowed, and it typically is not by default) and then everyone else
> would have to do special things (`git pull --rebase` in the simple
> case, rebuilding branches and tags in more complex cases) to get the
> new history.  Clearly for something like the law and the probable
> complex workflow it will have, this isn't a good method.

Well, if nobody is basing their work on this repository, and it is
meant as read-only source of information, that doesn't matter much.

> 
> What I would probably suggest is having either a historical branch or
> a historical repository which is allowed and expected to be rewritten.
[...]

Yet another solution would be to fix mistakes using `git replace`
mechanism.  It doesn't as much rewrite history, as paste on fixes;
this of course requires setting up sharing of those replacements
(fixes).

See git-replace(1) manpage for more information.

-- 
Jakub Narebski

  reply	other threads:[~2012-03-30 16:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30 13:34 Maintaining historical data in a git repo Yuval Adam
2012-03-30 15:10 ` Seth Robertson
2012-03-30 15:55   ` Yuval Adam
2012-03-30 16:18     ` Seth Robertson
2012-03-30 16:32       ` Jakub Narebski [this message]
2012-03-30 16:52     ` Junio C Hamano
2012-03-30 20:39       ` Yuval Adam
2012-03-30 22:29         ` david
2012-03-31  1:04         ` Mark Lodato
2012-04-01  4:14           ` Holding, Lawrence
2012-04-02 11:38         ` Ævar Arnfjörð Bjarmason
2012-04-03 19:45     ` Maintaining historical outlines Markus Elfring
2012-04-03  9:25 ` Maintaining historical data in a git repo Andreas Stricker

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=m3boneaw27.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=in-gitvger@baka.org \
    --cc=yuv.adm@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.
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).