Re: [PATCH v2 1/2] doc: merge-tree: provide a commit message
- From
- Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
- Date
- Oct 9, 2024, 16:35 UTC
- Message-ID
- <e339f796-bb9c-439f-a24c-0c5e79257379@app.fastmail.com>
- In-Reply-To
- <xmqqo73uz5qg.fsf@gitster.g>
On Tue, Oct 8, 2024, at 22:42, Junio C Hamano wrote:
Show 22 quoted lines
> 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`.
Show 12 quoted lines
> 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