Re: [PATCH] Deprecate support for .git/info/grafts
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Apr 13, 2018, 22:35 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1804132339130.234@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
- In-Reply-To
- <CAGZ79kbEec_U5wL_aOS5O_3+ZOshGwARALpjz801h-fRx-zotA@mail.gmail.com>
Hi Stefan,
On Fri, 13 Apr 2018, Stefan Beller wrote:
Show 6 quoted lines
> On Fri, Apr 13, 2018 at 4:11 AM, Johannes Schindelin > <johannes.schindelin@gmx.de> wrote: > > The grafts feature was a convenient way to "stich together" ancient > > history to the fresh start of linux.git. > > Did you mean: stitch?
Yes ;-)
Show 18 quoted lines
> > Its implementation is, however, not up to Git's standards, as there are > > too many ways where it can lead to surprising and unwelcome behavior. > > > > For example, when pushing from a repository with active grafts, it is > > possible to miss commits that have been "grafted out", resulting in a > > broken state on the other side. > > > > Also, the grafts feature is limited to "rewriting" commits' list of > > parents, it cannot replace anything else. > > > > The much younger feature implemented as `git replace` set out to remedy > > those limitations and dangerous bugs. > > > > Seeing as `git replace` is pretty mature by now, it is time to deprecate > > support for the graft file, and to retire it eventually. > > It seems that the maturity needed for this commit was reached in > 4228e8bc98 (replace: add --graft option, 2014-07-19)
Right. I'll add that to the commit message.
Show 24 quoted lines
> Reviewed-by: Stefan Beller <sbeller@google.com>
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
>
> > return -1;
> > + if (advice_graft_file_deprecated)
> > + advise(_("Support for <GIT_DIR>/info/grafts is deprecated\n"
> > + "and will be removed in a future Git version.\n"
> > + "\n"
> > + "Please use \"git replace --graft [...]\" instead.\n"
> > + "\n"
> > + "Turn this message off by running\n"
> > + "\"git config advice.graftFileDeprecated false\""));
>
> So the user would have to run:
>
> for line in <GIT_DIR>/info/grafts:
> git replace --graft $line
> # The order in the grafts file is the same as the arguments,
> # but we'd have to pass each as its own argument
> rm <GIT_DIR>/info/grafts
>
> I wonder if we want to offer a migration tool or just leave it
> at this hint.There is contrib/convert-grafts-to-replace-refs.sh.
I wonder whether we have to care enough to implement a `git replace --convert-graft-file`...
Ciao, Dscho