git/Documentation
Junio C Hamano c3e2d18996 setup_reflog_action: document the rules for using GIT_REFLOG_ACTION
The set_reflog_action helper (in git-sh-setup) is designed to be
used once at the very top of a program, like this in "git am", for
example:

	set_reflog_action am

The helper function sets the given string to GIT_REFLOG_ACTION only
when GIT_REFLOG_ACTION is not yet set.  Thanks to this, "git am",
when run as the top-level program, will use "am" in GIT_REFLOG_ACTION
and the reflog entries made by whatever it does will record the
updates of refs done by "am".

Because of the conditional assignment, when "git am" is run as a
subprogram (i.e. an implementation detail) of "git rebase" that
already sets GIT_REFLOG_ACTION to its own name, the call in "git am"
to the helper function at the beginning will *not* have any effect.

So "git rebase" can do this:

	set_reflog_action rebase
	... do its own preparation, like checking out "onto" commit
        ... decide to do "format-patch" to "am" pipeline
        	git format-patch --stdout >mbox
		git am mbox

and the reflog entries made inside "git am" invocation will say
"rebase", not "am".

Calls to "git" commands that update refs would use GIT_REFLOG_ACTION
to record who did that update.  Most such calls in scripted Porcelains
do not define custom reflog message and rely on GIT_REFLOG_ACTION to
contain its (or its caller's, when it is called as a subprogram) name.

If a scripted Porcelain wants to record a custom reflog message for
a single invocation of "git" command (e.g. when "git rebase" uses
"git checkout" to detach HEAD at the commit a series is to be
replayed on), it needs to set GIT_REFLOG_ACTION to the custom
message and export it while calling the "git" command, but such an
assignment must be restricted to that single "git" invocation and
should not be left behind to affect later codepath.

Document the rules to avoid future confusion.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-19 10:54:00 -07:00
..
RelNotes Git 1.8.2.3 2013-05-09 13:31:17 -07:00
howto The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
technical The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
.gitattributes
.gitignore
CodingGuidelines CodingGuidelines: our documents are in AsciiDoc 2013-03-21 14:17:32 -07:00
Makefile Merge branch 'da/mergetool-docs' 2013-02-07 14:42:16 -08:00
SubmittingPatches
asciidoc.conf
blame-options.txt
build-docdep.perl
cat-texi.perl Documentation: Strip texinfo anchors to avoid duplicates 2013-04-03 16:14:19 -07:00
cmd-list.perl
config.txt documentation: trivial whitespace cleanups 2013-04-28 14:46:52 -07:00
date-formats.txt
diff-config.txt Merge branch 'mp/diff-algo-config' 2013-02-17 15:25:52 -08:00
diff-format.txt
diff-generate-patch.txt
diff-options.txt trivial: Add missing period in documentation 2013-05-28 15:15:29 -07:00
docbook-xsl.css
docbook.xsl
everyday.txt
fetch-options.txt
fix-texi.perl
git-add.txt add: Clarify documentation of -A and -u 2013-03-07 11:16:54 -08:00
git-am.txt
git-annotate.txt
git-apply.txt
git-archimport.txt
git-archive.txt archive: clarify explanation of --worktree-attributes 2013-04-11 17:38:45 -07:00
git-bisect-lk2009.txt
git-bisect.txt Merge branch 'mg/bisect-doc' 2013-02-14 10:29:01 -08:00
git-blame.txt
git-branch.txt
git-bundle.txt
git-cat-file.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-check-attr.txt
git-check-ignore.txt
git-check-ref-format.txt
git-checkout-index.txt
git-checkout.txt
git-cherry-pick.txt
git-cherry.txt
git-citool.txt
git-clean.txt
git-clone.txt
git-column.txt
git-commit-tree.txt
git-commit.txt Documentation/git-commit: Typo under --edit 2013-05-02 12:03:40 -07:00
git-config.txt
git-count-objects.txt
git-credential-cache--daemon.txt
git-credential-cache.txt
git-credential-store.txt
git-credential.txt doc: various spelling fixes 2013-04-12 12:00:52 -07:00
git-cvsexportcommit.txt
git-cvsimport.txt
git-cvsserver.txt
git-daemon.txt Merge branch 'jk/daemon-user-doc' into maint 2013-04-22 11:26:58 -07:00
git-describe.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-diff-files.txt
git-diff-index.txt
git-diff-tree.txt
git-diff.txt
git-difftool.txt
git-fast-export.txt
git-fast-import.txt
git-fetch-pack.txt
git-fetch.txt
git-filter-branch.txt Merge branch 'maint-1.8.1' into maint 2013-03-25 13:46:42 -07:00
git-fmt-merge-msg.txt
git-for-each-ref.txt
git-format-patch.txt
git-fsck-objects.txt
git-fsck.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-gc.txt
git-get-tar-commit-id.txt
git-grep.txt
git-gui.txt
git-hash-object.txt
git-help.txt
git-http-backend.txt doc/http-backend: match query-string in apache half-auth example 2013-04-13 22:27:06 -07:00
git-http-fetch.txt
git-http-push.txt
git-imap-send.txt
git-index-pack.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-init-db.txt
git-init.txt
git-instaweb.txt
git-log.txt
git-lost-found.txt
git-ls-files.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-ls-remote.txt
git-ls-tree.txt
git-mailinfo.txt
git-mailsplit.txt
git-merge-base.txt
git-merge-file.txt
git-merge-index.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt Merge branch 'yd/doc-merge-annotated-tag' into maint 2013-04-01 09:19:37 -07:00
git-mergetool--lib.txt
git-mergetool.txt
git-mktag.txt
git-mktree.txt
git-mv.txt
git-name-rev.txt
git-notes.txt
git-p4.txt
git-pack-objects.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-pack-redundant.txt
git-pack-refs.txt
git-parse-remote.txt
git-patch-id.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-peek-remote.txt
git-prune-packed.txt
git-prune.txt
git-pull.txt Merge branch 'maint-1.8.1' into maint 2013-03-27 10:51:10 -07:00
git-push.txt Merge branch 'jc/maint-push-refspec-default-doc' into maint 2013-03-26 12:40:14 -07:00
git-quiltimport.txt
git-read-tree.txt
git-rebase.txt
git-receive-pack.txt
git-reflog.txt
git-relink.txt
git-remote-ext.txt doc: various spelling fixes 2013-04-12 12:00:52 -07:00
git-remote-fd.txt
git-remote-helpers.txto
git-remote-testgit.txt
git-remote.txt remote: 'show' and 'prune' can take more than one remote 2013-04-24 13:13:21 -07:00
git-repack.txt
git-replace.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-repo-config.txt
git-request-pull.txt
git-rerere.txt
git-reset.txt
git-rev-list.txt
git-rev-parse.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-revert.txt
git-rm.txt
git-send-email.txt
git-send-pack.txt
git-sh-i18n--envsubst.txt
git-sh-i18n.txt
git-sh-setup.txt setup_reflog_action: document the rules for using GIT_REFLOG_ACTION 2013-06-19 10:54:00 -07:00
git-shell.txt
git-shortlog.txt
git-show-branch.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-show-index.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-show-ref.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-show.txt
git-stage.txt
git-stash.txt
git-status.txt Merge branch 'tb/document-status-u-tradeoff' into maint 2013-04-01 09:19:30 -07:00
git-stripspace.txt
git-submodule.txt Merge branch 'maint' 2013-02-27 10:10:28 -08:00
git-svn.txt doc: various spelling fixes 2013-04-12 12:00:52 -07:00
git-symbolic-ref.txt
git-tag.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-tar-tree.txt
git-tools.txt doc: various spelling fixes 2013-04-12 12:00:52 -07:00
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-update-ref.txt
git-update-server-info.txt
git-upload-archive.txt
git-upload-pack.txt
git-var.txt
git-verify-pack.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-verify-tag.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
git-web--browse.txt
git-whatchanged.txt
git-write-tree.txt
git.txt setup_reflog_action: document the rules for using GIT_REFLOG_ACTION 2013-06-19 10:54:00 -07:00
gitattributes.txt
gitcli.txt Merge branch 'gp/avoid-explicit-mention-of-dot-git-refs' into maint 2013-03-26 12:40:04 -07:00
gitcore-tutorial.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
gitcredentials.txt
gitcvs-migration.txt
gitdiffcore.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
gitglossary.txt
githooks.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
gitignore.txt
gitk.txt
gitmodules.txt
gitnamespaces.txt
gitremote-helpers.txt
gitrepository-layout.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
gitrevisions.txt
gittutorial-2.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
gittutorial.txt
gitweb.conf.txt gitweb/INSTALL: GITWEB_CONFIG_SYSTEM is for backward compatibility 2013-04-17 15:18:12 -07:00
gitweb.txt
gitworkflows.txt
glossary-content.txt Merge branch 'jn/glossary-revision' into maint 2013-05-03 15:12:16 -07:00
howto-index.sh
i18n.txt
install-doc-quick.sh
install-webdoc.sh
mailmap.txt
manpage-1.72.xsl
manpage-base-url.xsl.in
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-quote-apos.xsl
manpage-suppress-sp.xsl
merge-config.txt Merge branch 'da/mergetool-docs' 2013-02-07 14:42:16 -08:00
merge-options.txt Documentation: merging a tag is a special case 2013-03-21 15:47:38 -07:00
merge-strategies.txt git-merge(1): document diff-algorithm option to merge-recursive 2013-04-05 10:57:23 -07:00
pretty-formats.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
pretty-options.txt
pull-fetch-param.txt
rev-list-options.txt
revisions.txt The name of the hash function is "SHA-1", not "SHA1" 2013-04-15 11:08:37 -07:00
sequencer.txt
urls-remotes.txt
urls.txt
user-manual.conf
user-manual.txt Merge branch 'da/downcase-u-in-usage' into maint 2013-04-01 09:19:04 -07:00