"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Scott Bennett <sbennett1990@gmail.com>
Subject:
got.1: commit examples
To:
gameoftrees@openbsd.org
Date:
Tue, 19 May 2020 17:32:52 -0400

Download raw body.

Thread
Hi,

Sometimes when creating a commit it's useful to use a prepared commit
message from a separate file - for instance when applying errata patches
to a locally maintained -stable tree.

As I understand it, a 'commit -F' analogue is undesirable since it can lead
to more pain than good. So I'm proposing adding a couple examples to
the man page to give some hints on how to use a prepared message in
a commit. I received some most helpful clue-bats via mastodon and
it seems like others might benefit from the clue-bats too.

I tried inserting these new examples where it felt natural to list them
out in the flow of the whole section, but they could also easily stand
on their own.

Thoughts?
Scott Bennett

diff --git a/got/got.1 b/got/got.1
index 37523a3..0053990 100644
--- a/got/got.1
+++ b/got/got.1
@@ -1968,10 +1968,24 @@ Add new files and remove obsolete files in a
work tree directory:
 Create a new commit from local changes in a work tree directory
 with a pre-defined log message.
 .Pp
 .Dl $ got commit -m 'unify the buffer cache'
 .Pp
+Create a new commit from local changes in a work tree directory
+with a log message that has been prepared in the file
+.Pa /tmp/msg .
+If using
+.Xr ksh 1 :
+.Pp
+.Dl $ got commit -m '`cat /tmp/msg`'
+.Pp
+Or if using
+.Xr vi 1 :
+.Pp
+.Dl $ got commit
+.Dl :r /tmp/msg
+.Pp
 Update any work tree checked out from the
 .Dq unified-buffer-cache
 branch to the latest commit on this branch:
 .Pp
 .Dl $ got update


p.s. hopefully my webmail client didn't mangle the diff, despite its
best efforts