git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: git <git@vger.kernel.org>
Subject: Re: [RFC PATCH 0/4] interpret-trailers: introduce "move" action
Date: Fri, 6 Oct 2017 15:19:48 +0200	[thread overview]
Message-ID: <CAP8UFD2_ZC4J4eRxq04TJ6-xyK5oTqHM2qd+5HfPV7jcoShvqw@mail.gmail.com> (raw)
In-Reply-To: <fe023f38-01cc-2257-bbfe-3f4310193b41@redhat.com>

On Fri, Oct 6, 2017 at 2:39 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 06/10/2017 14:33, Christian Couder wrote:
>> Ok. I think you might want something called for example
>> "replaceIfIdenticalClose" where "IdenticalClose" means: "there is a
>> trailer with the same (<token>, <value>) pair above or below the line
>> where the replaced trailer will be put when ignoring trailers with a
>> different <token>".
>
> So basically "moveIfClosest" (move if last for where=end, move if first
> for where=begin; for where=after and where=before it would just end up
> doing nothing)?

First yeah these would not make sense anyway if where=after or where=before.

Now it would be strange to have "moveIfClosest" without having "move"
first and I don't see how "move" would be different from the existing
"replace".
Or maybe "move" means "replaceIfIdentical", in this case I think it
would help users to just call it "replaceIfIdentical".

Also there is "addIfDifferentNeighbor" so we already have "Neighbor"
which means "just above or below". Then if we use "Closest" I think it
will be harder to distinguish it from "Neighbor" than if we use
"Close".

That's why I think "replaceIfIdenticalClose" is better. It could
enable us to eventually use a regexp like
"(add|replace)(If(Different|Identical)(Close|Neighbor)+)+"  to parse
the add* and replace* options.

  reply	other threads:[~2017-10-06 13:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05 13:22 [RFC PATCH 0/4] interpret-trailers: introduce "move" action Paolo Bonzini
2017-10-05 13:22 ` [PATCH 1/4] trailer: push free_arg_item up Paolo Bonzini
2017-10-05 13:22 ` [PATCH 2/4] trailer: simplify check_if_different Paolo Bonzini
2017-10-05 13:22 ` [PATCH 3/4] trailer: create a new function to handle adding trailers Paolo Bonzini
2017-10-05 13:22 ` [PATCH 4/4] trailer: add "move" configuration for trailer.ifExists Paolo Bonzini
2017-10-06  6:44 ` [RFC PATCH 0/4] interpret-trailers: introduce "move" action Junio C Hamano
2017-10-06  7:26   ` Paolo Bonzini
2017-10-06 10:30 ` Christian Couder
2017-10-06 10:40   ` Paolo Bonzini
2017-10-06 12:33     ` Christian Couder
2017-10-06 12:39       ` Paolo Bonzini
2017-10-06 13:19         ` Christian Couder [this message]
2017-10-06 13:49           ` Paolo Bonzini
2017-10-07  0:51         ` Junio C Hamano

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=CAP8UFD2_ZC4J4eRxq04TJ6-xyK5oTqHM2qd+5HfPV7jcoShvqw@mail.gmail.com \
    --to=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pbonzini@redhat.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.
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).