Re: How to "pre-populate" a git message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]