Re: [PATCH] Deprecate support for .git/info/grafts
- From
Stefan Beller <sbeller@google.com>
- Date
- Apr 13, 2018, 18:22 UTC
- Message-ID
- <CAGZ79kbEec_U5wL_aOS5O_3+ZOshGwARALpjz801h-fRx-zotA@mail.gmail.com>
- In-Reply-To
- <0f0942043678fe76f8d654306482ee26fac643f0.1523617836.git.johannes.schindelin@gmx.de>
Hi Johannes,
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?
Show 15 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)
Reviewed-by: Stefan Beller <sbeller@google.com>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > ---
Show 9 quoted lines
> 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/graftsI wonder if we want to offer a migration tool or just leave it at this hint.
Thanks, Stefan