2005-05-10 21:32:30 +00:00
|
|
|
git-commit-tree(1)
|
|
|
|
==================
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2007-01-18 23:53:37 +00:00
|
|
|
git-commit-tree - Create a new commit object
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2011-07-02 02:38:26 +00:00
|
|
|
[verse]
|
usage: do not insist that standard input must come from a file
The synopsys text and the usage string of subcommands that read list
of things from the standard input are often shown like this:
git gostak [--distim] < <list-of-doshes>
This is problematic in a number of ways:
* The way to use these commands is more often to feed them the
output from another command, not feed them from a file.
* Manual pages outside Git, commands that operate on the data read
from the standard input, e.g "sort", "grep", "sed", etc., are not
described with such a "< redirection-from-file" in their synopsys
text. Our doing so introduces inconsistency.
* We do not insist on where the output should go, by saying
git gostak [--distim] < <list-of-doshes> > <output>
* As it is our convention to enclose placeholders inside <braket>,
the redirection operator followed by a placeholder filename
becomes very hard to read, both in the documentation and in the
help text.
Let's clean them all up, after making sure that the documentation
clearly describes the modes that take information from the standard
input and what kind of things are expected on the input.
[jc: stole example for fmt-merge-msg from Jonathan]
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-16 18:27:42 +00:00
|
|
|
'git commit-tree' <tree> [(-p <parent>)...]
|
2013-03-25 21:00:07 +00:00
|
|
|
'git commit-tree' [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]
|
|
|
|
[(-F <file>)...] <tree>
|
|
|
|
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2007-01-17 21:03:29 +00:00
|
|
|
This is usually not what an end user wants to run directly. See
|
2007-12-29 06:20:38 +00:00
|
|
|
linkgit:git-commit[1] instead.
|
2007-01-17 21:03:29 +00:00
|
|
|
|
2005-05-10 21:32:30 +00:00
|
|
|
Creates a new commit object based on the provided tree object and
|
2011-11-09 19:54:04 +00:00
|
|
|
emits the new commit object id on stdout. The log message is read
|
|
|
|
from the standard input, unless `-m` or `-F` options are given.
|
2005-05-10 21:32:30 +00:00
|
|
|
|
2008-08-08 07:52:55 +00:00
|
|
|
A commit object may have any number of parents. With exactly one
|
|
|
|
parent, it is an ordinary commit. Having more than one parent makes
|
|
|
|
the commit a merge between several lines of history. Initial (root)
|
|
|
|
commits have no parents.
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
While a tree represents a particular directory state of a working
|
|
|
|
directory, a commit represents that state in "time", and explains how
|
|
|
|
to get there.
|
|
|
|
|
2013-01-21 19:17:53 +00:00
|
|
|
Normally a commit would identify a new "HEAD" state, and while Git
|
2005-05-10 21:32:30 +00:00
|
|
|
doesn't care where you save the note about that state, in practice we
|
2005-11-17 05:32:44 +00:00
|
|
|
tend to just write the result to the file that is pointed at by
|
|
|
|
`.git/HEAD`, so that we can always see what the last committed
|
|
|
|
state was.
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
<tree>::
|
|
|
|
An existing tree object
|
|
|
|
|
2011-11-09 19:54:04 +00:00
|
|
|
-p <parent>::
|
2016-06-28 11:40:10 +00:00
|
|
|
Each `-p` indicates the id of a parent commit object.
|
2007-06-07 07:04:01 +00:00
|
|
|
|
2011-11-09 19:54:04 +00:00
|
|
|
-m <message>::
|
2012-06-19 17:56:09 +00:00
|
|
|
A paragraph in the commit log message. This can be given more than
|
2011-11-09 19:54:04 +00:00
|
|
|
once and each <message> becomes its own paragraph.
|
|
|
|
|
|
|
|
-F <file>::
|
|
|
|
Read the commit log message from the given file. Use `-` to read
|
|
|
|
from the standard input.
|
|
|
|
|
2013-03-25 21:00:07 +00:00
|
|
|
-S[<keyid>]::
|
2013-12-13 23:40:35 +00:00
|
|
|
--gpg-sign[=<keyid>]::
|
2015-09-19 07:47:50 +00:00
|
|
|
GPG-sign commits. The `keyid` argument is optional and
|
|
|
|
defaults to the committer identity; if specified, it must be
|
|
|
|
stuck to the option without a space.
|
2013-03-25 21:00:07 +00:00
|
|
|
|
2013-12-13 23:40:35 +00:00
|
|
|
--no-gpg-sign::
|
2016-05-02 21:58:45 +00:00
|
|
|
Do not GPG-sign commit, to countermand a `--gpg-sign` option
|
|
|
|
given earlier on the command line.
|
2013-12-13 23:40:35 +00:00
|
|
|
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
Commit Information
|
|
|
|
------------------
|
|
|
|
|
|
|
|
A commit encapsulates:
|
|
|
|
|
|
|
|
- all parent object ids
|
|
|
|
- author name, email and date
|
|
|
|
- committer name and email and the commit time.
|
|
|
|
|
2007-08-17 20:13:36 +00:00
|
|
|
While parent object ids are provided on the command line, author and
|
2007-08-24 00:44:13 +00:00
|
|
|
committer information is taken from the following environment variables,
|
2007-08-17 20:13:36 +00:00
|
|
|
if set:
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
GIT_AUTHOR_NAME
|
|
|
|
GIT_AUTHOR_EMAIL
|
|
|
|
GIT_AUTHOR_DATE
|
|
|
|
GIT_COMMITTER_NAME
|
|
|
|
GIT_COMMITTER_EMAIL
|
2007-04-29 01:40:12 +00:00
|
|
|
GIT_COMMITTER_DATE
|
2005-05-10 21:32:30 +00:00
|
|
|
|
2005-10-03 17:16:30 +00:00
|
|
|
(nb "<", ">" and "\n"s are stripped)
|
2005-05-10 21:32:30 +00:00
|
|
|
|
2007-08-17 20:13:36 +00:00
|
|
|
In case (some of) these environment variables are not set, the information
|
|
|
|
is taken from the configuration items user.name and user.email, or, if not
|
2013-01-10 12:29:58 +00:00
|
|
|
present, the environment variable EMAIL, or, if that is not set,
|
|
|
|
system user name and the hostname used for outgoing mail (taken
|
ident: check /etc/mailname if email is unknown
Before falling back to gethostname(), check /etc/mailname if
GIT_AUTHOR_EMAIL is not set in the environment or through config
files. Only fall back if /etc/mailname cannot be opened or read.
The /etc/mailname convention comes from Debian policy section 11.6
("mail transport, delivery and user agents"), though maybe it could be
useful sometimes on other machines, too. The lack of this support was
noticed by various people in different ways:
- Ian observed that git was choosing the address
'ian@anarres.relativity.greenend.org.uk' rather than
'ian@davenant.greenend.org.uk' as it should have done.
- Jonathan noticed that operations like "git commit" were needlessly
slow when using a resolver that was slow to handle reverse DNS
lookups.
Alas, after this patch, if /etc/mailname is set up and the [user] name
and email configuration aren't, the committer email will not provide a
charming reminder of which machine commits were made on any more. But
I think it's worth it.
Mechanics: the functionality of reading mailname goes in its own
function, so people who care about other distros can easily add an
implementation to a similar location without making copy_email() too
long and losing clarity. While at it, we split out the fallback
default logic that does gethostname(), too (rearranging it a little
and adding a check for errors from gethostname while at it).
Based on a patch by Gerrit Pape <pape@smarden.org>.
Requested-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-03 06:16:33 +00:00
|
|
|
from `/etc/mailname` and falling back to the fully qualified hostname when
|
|
|
|
that file does not exist).
|
2005-10-29 21:32:56 +00:00
|
|
|
|
2007-07-15 05:56:47 +00:00
|
|
|
A commit comment is read from stdin. If a changelog
|
2010-01-09 23:33:00 +00:00
|
|
|
entry is not provided via "<" redirection, 'git commit-tree' will just wait
|
2005-10-03 17:16:30 +00:00
|
|
|
for one to be entered and terminated with ^D.
|
2005-05-10 21:32:30 +00:00
|
|
|
|
2009-12-02 23:49:19 +00:00
|
|
|
include::date-formats.txt[]
|
2005-10-29 21:32:56 +00:00
|
|
|
|
2006-12-30 10:22:38 +00:00
|
|
|
Discussion
|
|
|
|
----------
|
|
|
|
|
|
|
|
include::i18n.txt[]
|
|
|
|
|
ident: check /etc/mailname if email is unknown
Before falling back to gethostname(), check /etc/mailname if
GIT_AUTHOR_EMAIL is not set in the environment or through config
files. Only fall back if /etc/mailname cannot be opened or read.
The /etc/mailname convention comes from Debian policy section 11.6
("mail transport, delivery and user agents"), though maybe it could be
useful sometimes on other machines, too. The lack of this support was
noticed by various people in different ways:
- Ian observed that git was choosing the address
'ian@anarres.relativity.greenend.org.uk' rather than
'ian@davenant.greenend.org.uk' as it should have done.
- Jonathan noticed that operations like "git commit" were needlessly
slow when using a resolver that was slow to handle reverse DNS
lookups.
Alas, after this patch, if /etc/mailname is set up and the [user] name
and email configuration aren't, the committer email will not provide a
charming reminder of which machine commits were made on any more. But
I think it's worth it.
Mechanics: the functionality of reading mailname goes in its own
function, so people who care about other distros can easily add an
implementation to a similar location without making copy_email() too
long and losing clarity. While at it, we split out the fallback
default logic that does gethostname(), too (rearranging it a little
and adding a check for errors from gethostname while at it).
Based on a patch by Gerrit Pape <pape@smarden.org>.
Requested-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-03 06:16:33 +00:00
|
|
|
FILES
|
|
|
|
-----
|
|
|
|
/etc/mailname
|
|
|
|
|
2008-05-28 23:55:27 +00:00
|
|
|
SEE ALSO
|
2005-05-10 21:32:38 +00:00
|
|
|
--------
|
2007-12-29 06:20:38 +00:00
|
|
|
linkgit:git-write-tree[1]
|
2005-05-10 21:32:30 +00:00
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
2008-06-06 07:07:32 +00:00
|
|
|
Part of the linkgit:git[1] suite
|