git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sergey Organov <sorganov@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Chris Torek <chris.torek@gmail.com>,
	Hongyi Zhao <hongyi.zhao@gmail.com>,
	Phillip Susi <phill@thesusis.net>, Git List <git@vger.kernel.org>
Subject: Re: git revert with partial commit.
Date: Wed, 05 Apr 2023 09:39:25 +0300	[thread overview]
Message-ID: <87wn2qg7du.fsf@osv.gnss.ru> (raw)
In-Reply-To: <CAMP44s2od_=3p8+GF7tSBqQ0KsDaa4qVKXS66BS7L7BJadA_Xw@mail.gmail.com> (Felipe Contreras's message of "Tue, 4 Apr 2023 16:14:46 -0500")

Felipe Contreras <felipe.contreras@gmail.com> writes:

> On Tue, Apr 4, 2023 at 3:08 PM Sergey Organov <sorganov@gmail.com> wrote:
>>
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>> > Sergey Organov <sorganov@gmail.com> writes:
>> >
>> >>> This kind of operation produces a new commit, so there's no such
>> >>> thing as a partial revert or partial cherry-pick, at least in
>> >>> terms of "things Git can do by itself".  But we, as humans writing
>> >>> programs, wish to *achieve* such things.
>> >>
>> >> So, why Git can't help us achieving it by supporting paths limiting in
>> >> (all) merge operations? There seems to be no absolute obstacles, just a
>> >> luck of support.
>> >
>> > I think there is no fundamental reason to forbid an optional
>> > pathspec to "cherry-pick" and "revert", given that a commit that
>> > results from either "git cherry-pick" or "git revert" is called a
>> > "cherry-pick" or a "revert" merely by convention and there is no
>> > tool-level support to treat them any specially at merge or rebase
>> > time [*1*].  It would make it harder to design tool-level support
>> > for full cherry-picks or reverts, but that is a problem for future
>> > generation, not ours ;-)  Allowing pathspec to "merge" and recording
>> > the result as a merge of two (or more) parents is an absolute no-no
>> > but that is not what we are discussing.
>>
>> If I got this right, you believe that "git merge" should never have
>> support for "partial merges", whereas it makes sense for cherry-pick and
>> revert? If so, I disagree. There is no reason for Git to strictly
>> prevent me from using the feature specifically in "git merge" (once it's
>> otherwise implemented), provided I do mean it and didn't do it by
>> mistake.
>>
>> Please notice that I can do it right now already (and I did a few
>> times), only with a more pain than necessary, and I don't see why this
>> pain is to be preserved (provided we do have the feature implemented in
>> the future). Besides, "git merge" is only a helper, and it'd be an
>> improvement if it'll be capable to help in more cases.
>
> This sounds awfully familiar to Mercurial's reluctance to support
> rewriting history. It wasn't the tool's place to prescribe what the
> users should or shouldn't do.
>
> If the user wants to do it, the tool should help him do it, not
> pontificate about what is heretic.
>
> The user is still going to do it, like with a rebase plugin on
> Mercurial, or with `git filter-branch` and then merge the result. All
> the tool is achieving is being annoying by not helping the user.

Yep, and I'm worried by such trends in Git as well. Looks like growing
influence of software development culture where the user is not
considered to be intelligent enough to make proper decisions by himself,
and needs to be thoroughly guided by the tool (designers) all the time.

Thanks,
-- Sergey Organov

  reply	other threads:[~2023-04-05  6:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-02  9:17 git revert with partial commit Hongyi Zhao
2023-04-02 14:16 ` Torsten Bögershausen
2023-04-03 17:07   ` Junio C Hamano
2023-04-04  0:28   ` Hongyi Zhao
2023-04-03 18:29 ` Phillip Susi
2023-04-04  0:20   ` Hongyi Zhao
2023-04-04  0:37     ` Hongyi Zhao
2023-04-04 15:50       ` Hongyi Zhao
2023-04-04 16:19         ` Chris Torek
2023-04-04 17:21           ` Sergey Organov
2023-04-04 18:20             ` Junio C Hamano
2023-04-04 19:40               ` Sergey Organov
2023-04-04 19:48                 ` Junio C Hamano
2023-04-04 21:14                 ` Felipe Contreras
2023-04-05  6:39                   ` Sergey Organov [this message]
2023-04-07  0:24                     ` Felipe Contreras
2023-04-07 17:20                       ` Sergey Organov
2023-04-06 15:48     ` Phillip Susi

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wn2qg7du.fsf@osv.gnss.ru \
    --to=sorganov@gmail.com \
    --cc=chris.torek@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hongyi.zhao@gmail.com \
    --cc=phill@thesusis.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).