git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
	 Josef Wolf <jw@raven.inka.de>,
	 git@vger.kernel.org
Subject: Re: renormalize histroy with smudge/clean-filter
Date: Thu, 06 Feb 2025 11:00:34 -0800	[thread overview]
Message-ID: <xmqqcyfukiel.fsf@gitster.g> (raw)
In-Reply-To: <CABPp-BHkUW7NVatPOVeBPybwSq9s-HjJ1FTgwU0eZRStatfXMA@mail.gmail.com> (Elijah Newren's message of "Wed, 5 Feb 2025 23:55:34 -0800")

Elijah Newren <newren@gmail.com> writes:

> I kind of think we need a way to ask git "how would renormalization
> modify this buffer if it were at this path" short of creating a full
> index and checkout.

That makes it sound as if you are asking for "diff/patch" between
pre- and post- renormalization operation, but wouldn't the question
be more like "pretend this buffer content were at this path in a
checkout of this tree-ish.  Now compute what 'git add --renormalize'
would give us for that path".


What would it take?  

 - An equivalent of the in-core index (but you need to specify from
   which tree-ish it should be taken from) so that you can learn
   what attributes are attached to the path in question.  You may
   want to grab`filter`, `ident`, `working-tree-encoding`, etc. out
   of the attribute subsystem.

 - Access to the "config" data, to learn what exact commands to
   spawn to filter the buffer for, and what encoding and line
   terminating conventions are used for given path.  You may want to
   grab values of "filter.<name>.{clean,smudge}", "core.eol", etc.,
   for example.

 - A sandbox to safely run these external commands needed for
   smudge/clean filters.

It does not sound entirely trivial, but it does not look too much
of recket science, either.

  reply	other threads:[~2025-02-06 19:00 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-05 21:47 renormalize histroy with smudge/clean-filter Josef Wolf
2025-02-05 22:55 ` brian m. carlson
2025-02-05 23:59   ` Josef Wolf
2025-02-06  0:29     ` brian m. carlson
2025-02-06  8:07       ` Elijah Newren
2025-02-06 13:40         ` Josef Wolf
2025-02-06 20:04           ` Josef Wolf
2025-02-07  6:10             ` Chris Torek
2025-02-07 10:45               ` Josef Wolf
2025-02-07 11:06                 ` Torsten Bögershausen
2025-02-07 11:12                 ` Chris Torek
2025-02-07 11:17                   ` Chris Torek
2025-02-07 14:01                   ` Elijah Newren
2025-02-07 20:32                     ` Josef Wolf
2025-02-08  0:23                       ` Elijah Newren
2025-02-08 11:14                         ` Phillip Wood
2025-02-08 21:08                           ` Josef Wolf
2025-02-08 21:43                           ` Elijah Newren
2025-02-08 23:26                             ` Josef Wolf
2025-02-09  2:33                               ` D. Ben Knoble
2025-02-09  8:53                                 ` Josef Wolf
2025-02-09  7:21                               ` Elijah Newren
2025-02-09  8:57                                 ` Josef Wolf
2025-02-10 17:51                                   ` D. Ben Knoble
2025-02-08 20:57                         ` Josef Wolf
2025-02-08 21:56                           ` Elijah Newren
2025-02-09  9:25                           ` Josef Wolf
2025-02-09 11:14                             ` Torsten Bögershausen
2025-02-09 15:09                               ` Josef Wolf
2025-02-09 17:54                                 ` Josef Wolf
2025-02-09 18:01                                   ` Josef Wolf
2025-02-07 20:21                   ` Josef Wolf
2025-02-07 15:39                 ` Junio C Hamano
2025-02-06 10:13     ` Phillip Wood
2025-02-06  7:55   ` Elijah Newren
2025-02-06 19:00     ` Junio C Hamano [this message]
2025-02-11 23:57 ` renormalize histroy with smudge/clean-filter, again Josef Wolf
2025-02-12  6:12   ` Torsten Bögershausen
2025-02-12  8:18     ` Josef Wolf
2025-02-13 11:36   ` Collisions while cloning (was: Re: renormalize histroy with smudge/clean-filter, again) Josef Wolf
2025-02-13 16:40     ` Torsten Bögershausen
2025-02-14 20:03   ` renormalize histroy with smudge/clean-filter, again Josef Wolf
2025-02-14 20:21   ` brian m. carlson
2025-02-14 20:55     ` Josef Wolf

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=xmqqcyfukiel.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jw@raven.inka.de \
    --cc=newren@gmail.com \
    --cc=sandals@crustytoothpaste.net \
    /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).