git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org, "Eric Sunshine" <sunshine@sunshineco.com>,
	"Elijah Newren" <newren@gmail.com>,
	"Phillip Wood" <phillip.wood123@gmail.com>
Subject: Re: [PATCH v2 1/2] doc: merge-tree: provide a commit message
Date: Wed, 09 Oct 2024 18:35:36 +0200	[thread overview]
Message-ID: <e339f796-bb9c-439f-a24c-0c5e79257379@app.fastmail.com> (raw)
In-Reply-To: <xmqqo73uz5qg.fsf@gitster.g>

On Tue, Oct 8, 2024, at 22:42, Junio C Hamano wrote:
> Kristoffer Haugsbakk <code@khaugsbakk.name> writes:
>
>> Provide a commit message in the example command.
>>
>> The command will hang since it is waiting for a commit message on
>> stdin.  Which is usable but not straightforward enough since this is
>> example code.
>>
>> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
>> ---
>
> Makes sense.
>
>> -       NEWCOMMIT=$(git commit-tree $NEWTREE -p $BRANCH1 -p $BRANCH2)
>> +       NEWCOMMIT=$(git commit-tree $NEWTREE -F $FILE_WITH_COMMIT_MESSAGE \
>> +           -p $BRANCH1 -p $BRANCH2)
>>         git update-ref $BRANCH1 $NEWCOMMIT
>
> The shell should know, after seeing $FILE_WITH_COMMIT_MESSAGE and
> encountering the end of line, that you haven't completed telling
> what you started telling it.  Do you need " \" at the end of the
> line?

I tried that and got an error: `-p: not found`.

> I know that it was suggested to use a file with message, and I agree
> with the suggestion, but then I wonder if we want to be more
> complete and show that a file gets prepared in the example to avoid
> making readers wonder where $FILE_WITH_COMMIT_MESSAGE comes from?
>
> E.g.,
>
>         vi message.txt
>         NEWCOMMIT=$(git comimt-tree $NEWTREE -F message.txt
>                     -p $BRANCH1 -p $BRANCH2)
>
> or something like that?

I’ll do that.

--
Kristoffer but any Christopher-variation is fine

  parent reply	other threads:[~2024-10-09 16:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07 11:10 [PATCH 0/3] doc: merge-tree: improve the script example Kristoffer Haugsbakk
2024-10-07 11:10 ` [PATCH 1/3] doc: merge-tree: provide a commit message Kristoffer Haugsbakk
2024-10-07 12:02   ` Kristoffer Haugsbakk
2024-10-07 15:17   ` Elijah Newren
2024-10-07 15:23     ` Kristoffer Haugsbakk
2024-10-07 11:10 ` [PATCH 2/3] doc: merge-tree: use lower-case variables Kristoffer Haugsbakk
2024-10-07 14:58   ` Phillip Wood
2024-10-07 15:22     ` Elijah Newren
2024-10-07 11:10 ` [PATCH 3/3] doc: merge-tree: use || directly Kristoffer Haugsbakk
2024-10-07 15:24   ` Elijah Newren
2024-10-07 15:44     ` Kristoffer Haugsbakk
2024-10-07 14:59 ` [PATCH 0/3] doc: merge-tree: improve the script example Phillip Wood
2024-10-07 15:00   ` Kristoffer Haugsbakk
2024-10-08 19:06 ` [PATCH v2 0/2] " Kristoffer Haugsbakk
2024-10-08 19:06   ` [PATCH v2 1/2] doc: merge-tree: provide a commit message Kristoffer Haugsbakk
2024-10-08 20:42     ` Junio C Hamano
2024-10-08 20:44       ` Kristoffer Haugsbakk
2024-10-09 16:35       ` Kristoffer Haugsbakk [this message]
2024-10-09 17:38         ` Junio C Hamano
2024-10-09 16:58       ` Andreas Schwab
2024-10-08 19:06   ` [PATCH v2 2/2] doc: merge-tree: use || directly Kristoffer Haugsbakk
2024-10-08 20:44     ` Junio C Hamano
2024-10-08 20:48       ` Kristoffer Haugsbakk
2024-10-09 16:53   ` [PATCH v3 0/1] doc: merge-tree: improve the script example Kristoffer Haugsbakk
2024-10-09 16:53     ` [PATCH v3 1/1] doc: merge-tree: improve example script Kristoffer Haugsbakk
2024-10-09 20:50     ` [PATCH v3 0/1] doc: merge-tree: improve the script example Elijah Newren
2024-10-10  0:01       ` 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

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

  git send-email \
    --in-reply-to=e339f796-bb9c-439f-a24c-0c5e79257379@app.fastmail.com \
    --to=kristofferhaugsbakk@fastmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    --cc=phillip.wood123@gmail.com \
    --cc=sunshine@sunshineco.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.
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).