Git development
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Larry Martell <larry.martell@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: hook to get info on commit, and include that in a file that is part of the commit
Date: Tue, 5 Feb 2019 02:40:56 +0000	[thread overview]
Message-ID: <20190205024055.GD527887@genre.crustytoothpaste.net> (raw)
In-Reply-To: <CACwCsY7o=ArM4T4n7umun-R9Dip5NmmOEL7Ygd9zEQdCyQa4Og@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]

On Mon, Feb 04, 2019 at 09:18:14PM -0500, Larry Martell wrote:
> On Mon, Feb 4, 2019 at 9:15 PM brian m. carlson
> <sandals@crustytoothpaste.net> wrote:
> > If you want to generate a file, you can certainly do that in the
> > post-commit hook or using a Makefile target. You just can't check it
> > into the repo. Lots of projects do this as part of their build process.
> >
> > An example of what you could do is "git log --pretty='tformat:%H%n%B' HEAD".
> > That will print the commit hash and commit message to standard output
> > for each commit. If you want just one commit, you can use "-1".
> 
> Yeah, but I want it part of the repo so it makes it to the target system.

You can create an additional commit for each commit that you put in with
the additional file, or you can serialize it as a note for the commit
(using git notes), which can then be pushed to the remote server by
pushing refs/notes/commits.

I'm not aware of any other way to do what you want.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]

  reply	other threads:[~2019-02-05  2:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05  1:36 hook to get info on commit, and include that in a file that is part of the commit Larry Martell
2019-02-05  1:55 ` brian m. carlson
2019-02-05  2:00   ` Larry Martell
2019-02-05  2:15     ` brian m. carlson
2019-02-05  2:18       ` Larry Martell
2019-02-05  2:40         ` brian m. carlson [this message]
2019-02-05  2:42           ` Larry Martell

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=20190205024055.GD527887@genre.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=larry.martell@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