git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dirk Süsserott" <newsletter@dirk.my1.cc>
To: Patrick Doyle <wpdster@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: How to "pre-populate" a git message
Date: Fri, 03 Dec 2010 20:36:40 +0100	[thread overview]
Message-ID: <4CF946C8.6050009@dirk.my1.cc> (raw)
In-Reply-To: <AANLkTim=dVxVLL31aEBrjw7OhXpdYOjAO9Sk16gGP3zJ@mail.gmail.com>

Am 03.12.2010 18:51 schrieb Patrick Doyle:
> Once in a while, I would like to run some scripts that will
> automatically generate some files that I keep maintained in my
> repository.
>
> I also like to review the files before they get committed.
>
> Is there any way I can "pre-populate" the commit message so that I can
> run my "regenerate" command, review the differences, and then commit
> the changes with my prewritten message?
>
> --wpd

You can either commit the changes with the "-m <msg>" or with the
"-F <file>" switch. In your case I'd suggest the latter:

1. regenerate your files and include a step that generates
    a commit message and stores that in a file, say "commit.msg".
2. review the changes
3. add all your files (except for "commit.msg", of course)
4. commit:
      $ git commit -F commit.msg

The other way would be the -m switch, but then you'd have to supply
the message by yourself somehow:
$ git commit -m "These files were generated at ..."


HTH,
     Dirk

      parent reply	other threads:[~2010-12-03 19:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-03 17:51 How to "pre-populate" a git message Patrick Doyle
2010-12-03 19:29 ` Jonathan Nieder
2010-12-03 19:36 ` Dirk Süsserott [this message]

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=4CF946C8.6050009@dirk.my1.cc \
    --to=newsletter@dirk.my1.cc \
    --cc=git@vger.kernel.org \
    --cc=wpdster@gmail.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).