<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-sh-setup.txt, branch v2.3.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2013-10-18T20:50:12Z</updated>
<entry>
<title>Merge branch 'jc/reflog-doc'</title>
<updated>2013-10-18T20:50:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-10-18T20:50:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6c2bec96a8215bad7745d559c631e45332c5a9ee'/>
<id>urn:sha1:6c2bec96a8215bad7745d559c631e45332c5a9ee</id>
<content type='text'>
Document rules to use GIT_REFLOG_ACTION variable in the scripted
Porcelain.  git-rebase--interactive locally violates them, but it
is a leaf user that does not call out to or dot-source other
scripts, so it does not urgently need to be fixed.

* jc/reflog-doc:
  setup_reflog_action: document the rules for using GIT_REFLOG_ACTION
</content>
</entry>
<entry>
<title>setup_reflog_action: document the rules for using GIT_REFLOG_ACTION</title>
<updated>2013-06-19T17:54:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-06-19T17:54:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c3e2d18996e4ef92f37bf56b2fefe2124d26659e'/>
<id>urn:sha1:c3e2d18996e4ef92f37bf56b2fefe2124d26659e</id>
<content type='text'>
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 &gt;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 &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools/p4merge: create a base if none available</title>
<updated>2013-03-13T17:46:07Z</updated>
<author>
<name>Kevin Bracey</name>
<email>kevin@bracey.fi</email>
</author>
<published>2013-03-13T01:12:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4549162e8d623d69ea48745fce3709e5133ce043'/>
<id>urn:sha1:4549162e8d623d69ea48745fce3709e5133ce043</id>
<content type='text'>
Originally, with no base, Git gave P4Merge $LOCAL as a dummy base:

   p4merge "$LOCAL" "$LOCAL" "$REMOTE" "$MERGED"

Commit 0a0ec7bd changed this to:

   p4merge "empty file" "$LOCAL" "$REMOTE" "$MERGED"

to avoid the problem of being unable to save in some circumstances with
similar inputs.

Unfortunately this approach produces much worse results on differing
inputs. P4Merge really regards the blank file as the base, and once you
have just a couple of differences between the two branches you end up
with one a massive full-file conflict. The 3-way diff is not readable,
and you have to invoke "difftool MERGE_HEAD HEAD" manually to get a
useful view.

The original approach appears to have invoked special 2-way merge
behaviour in P4Merge that occurs only if the base filename is "" or
equal to the left input.  You get a good visual comparison, and it does
not auto-resolve differences. (Normally if one branch matched the base,
it would autoresolve to the other branch).

But there appears to be no way of getting this 2-way behaviour and being
able to reliably save. Having base==left appears to be triggering other
assumptions. There are tricks the user can use to force the save icon
on, but it's not intuitive.

So we now follow a suggestion given in the original patch's discussion:
generate a virtual base, consisting of the lines common to the two
branches. This is the same as the technique used in resolve and octopus
merges, so we relocate that code to a shared function.

Note that if there are no differences at the same location, this
technique can lead to automatic resolution without conflict, combining
everything from the 2 files.  As with the other merges using this
technique, we assume the user will inspect the result before saving.

Signed-off-by: Kevin Bracey &lt;kevin@bracey.fi&gt;
Reviewed-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Documentation: the name of the system is 'Git', not 'git'</title>
<updated>2013-02-01T21:53:33Z</updated>
<author>
<name>Thomas Ackermann</name>
<email>th.acker@arcor.de</email>
</author>
<published>2013-01-21T19:17:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2de9b71138171dca7279db3b3fe67e868c76d921'/>
<id>urn:sha1:2de9b71138171dca7279db3b3fe67e868c76d921</id>
<content type='text'>
Signed-off-by: Thomas Ackermann &lt;th.acker@arcor.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tr/doc-sh-setup'</title>
<updated>2011-12-22T23:30:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-12-22T23:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f0ede8435ab161b3aba3e5e306239d6bd74dd9b8'/>
<id>urn:sha1:f0ede8435ab161b3aba3e5e306239d6bd74dd9b8</id>
<content type='text'>
* tr/doc-sh-setup:
  git-sh-setup: make require_clean_work_tree part of the interface
</content>
</entry>
<entry>
<title>git-sh-setup: make require_clean_work_tree part of the interface</title>
<updated>2011-12-20T22:01:41Z</updated>
<author>
<name>Thomas Rast</name>
<email>trast@student.ethz.ch</email>
</author>
<published>2011-12-20T21:42:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d577cd216e0adb9cbc726dddd1a0858b4ab4e6e3'/>
<id>urn:sha1:d577cd216e0adb9cbc726dddd1a0858b4ab4e6e3</id>
<content type='text'>
92c62a3 (Porcelain scripts: Rewrite cryptic "needs update" error
message, 2010-10-19) refactored git's own checking to a function in
git-sh-setup.  This is a very useful thing for script writers, so
document it.

Signed-off-by: Thomas Rast &lt;trast@student.ethz.ch&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Documentation: use [verse] for SYNOPSIS sections</title>
<updated>2011-07-06T21:26:26Z</updated>
<author>
<name>Martin von Zweigbergk</name>
<email>martin.von.zweigbergk@gmail.com</email>
</author>
<published>2011-07-02T02:38:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7791a1d9b9a4f4e15662c7c9c7f5837f461bb987'/>
<id>urn:sha1:7791a1d9b9a4f4e15662c7c9c7f5837f461bb987</id>
<content type='text'>
The SYNOPSIS sections of most commands that span several lines already
use [verse] to retain line breaks. Most commands that don't span
several lines seem not to use [verse]. In the HTML output, [verse]
does not only preserve line breaks, but also makes the section
indented, which causes a slight inconsistency between commands that
use [verse] and those that don't. Use [verse] in all SYNOPSIS sections
for consistency.

Also remove the blank lines from git-fetch.txt and git-rebase.txt to
align with the other man pages. In the case of git-rebase.txt, which
already uses [verse], the blank line makes the [verse] not apply to
the last line, so removing the blank line also makes the formatting
within the document more consistent.

While at it, add single quotes to 'git cvsimport' for consistency with
other commands.

Signed-off-by: Martin von Zweigbergk &lt;martin.von.zweigbergk@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/require-work-tree-exists'</title>
<updated>2011-05-26T17:31:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-05-26T17:31:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0a2a5d889dcd0982de31e1d4faee3242854d7b9d'/>
<id>urn:sha1:0a2a5d889dcd0982de31e1d4faee3242854d7b9d</id>
<content type='text'>
* jc/require-work-tree-exists:
  require-work-tree wants more than what its name says
</content>
</entry>
<entry>
<title>require-work-tree wants more than what its name says</title>
<updated>2011-05-24T18:34:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-05-05T02:11:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e2eb527345d48881dac0d88e6bdfc0a267a2eb62'/>
<id>urn:sha1:e2eb527345d48881dac0d88e6bdfc0a267a2eb62</id>
<content type='text'>
Somebody tried "git pull" from a random place completely outside the work
tree, while exporting GIT_DIR and GIT_WORK_TREE that are set to correct
places, e.g.

    GIT_WORK_TREE=$HOME/git.git
    GIT_DIR=$GIT_WORK_TREE/.git
    export GIT_WORK_TREE GIT_DIR
    cd /tmp
    git pull

At the beginning of git-pull, we check "require-work-tree" and then
"cd-to-toplevel".  I _think_ the original intention when I wrote the
command was "we MUST have a work tree, our $(cwd) might not be at the
top-level directory of it", and no stronger than that.  That check is a
very sensible thing to do before doing cd-to-toplevel.  We check that the
place we would want to go exists, and then go there.

But the implementation of require_work_tree we have today is quite
different.  I don't have energy to dig the history, but currently it says:

    test "$(git rev-parse --is-inside-work-tree 2&gt;/dev/null)" = true ||
    die "fatal: $0 cannot be used without a working tree."

Which is completely bogus.  Even though we may happen to be just outside
of it right now, we may have a working tree that we can cd_to_toplevel
back to.

Add a function "require_work_tree_exists" that implements the check
this function originally intended (this is so that third-party scripts
that rely on the current behaviour do not have to get broken).

For now, update _no_ in-tree scripts, not even "git pull", as nobody on
the list seems to really care about the above corner case workflow that
triggered this. Scripts can be updated after vetting that they do want the
"we want to make sure the place we are going to go actually exists"
semantics.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: drop author/documentation sections from most pages</title>
<updated>2011-03-11T15:59:16Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-03-11T05:52:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=48bb914ed641fc0880d86b16cbb17c84769c320a'/>
<id>urn:sha1:48bb914ed641fc0880d86b16cbb17c84769c320a</id>
<content type='text'>
The point of these sections is generally to:

  1. Give credit where it is due.

  2. Give the reader an idea of where to ask questions or
     file bug reports.

But they don't do a good job of either case. For (1), they
are out of date and incomplete. A much more accurate answer
can be gotten through shortlog or blame.  For (2), the
correct contact point is generally git@vger, and even if you
wanted to cc the contact point, the out-of-date and
incomplete fields mean you're likely sending to somebody
useless.

So let's drop the fields entirely from all manpages except
git(1) itself. We already point people to the mailing list
for bug reports there, and we can update the Authors section
to give credit to the major contributors and point to
shortlog and blame for more information.

Each page has a "This is part of git" footer, so people can
follow that to the main git manpage.
</content>
</entry>
</feed>
