<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/git-sh-setup.sh, branch v1.8.0.2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2012-08-29T21:49:45Z</updated>
<entry>
<title>Merge branch 'jc/maint-protect-sh-from-ifs'</title>
<updated>2012-08-29T21:49:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-08-29T21:49:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=72c4dbec2c782fd1f25694352c611374b3e56fe8'/>
<id>urn:sha1:72c4dbec2c782fd1f25694352c611374b3e56fe8</id>
<content type='text'>
When the user exports a non-default IFS without HT, scripts that
rely on being able to parse "ls-files -s | while read a b c..."
start to fail.  Protect them from such a misconfiguration.

* jc/maint-protect-sh-from-ifs:
  sh-setup: protect from exported IFS
</content>
</entry>
<entry>
<title>sh-setup: protect from exported IFS</title>
<updated>2012-08-08T21:36:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-08-08T19:08:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=785063e02bb249ef3a39db88575fe626b310d4a7'/>
<id>urn:sha1:785063e02bb249ef3a39db88575fe626b310d4a7</id>
<content type='text'>
Many scripted Porcelains rely on being able to split words at the
default $IFS characters, i.e. SP, HT and LF.  If the user exports a
non-default IFS to the environment, what they read from plumbing
commands such as ls-files that use HT to delimit fields may not be
split in the way we expect.

Protect outselves by resetting it, just like we do so against CDPATH
exported to the environment.

Noticed by Andrew Dranse &lt;adranse@oanda.com&gt;.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-sh-setup: define workaround wrappers before they are used</title>
<updated>2012-05-16T17:44:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-05-16T17:36:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=10587ce6dfb479cf4930657e173b673031deaa06'/>
<id>urn:sha1:10587ce6dfb479cf4930657e173b673031deaa06</id>
<content type='text'>
Recently we tweaked this scriptlet to let mingw port redefine "pwd" to
always return Windows-style path, but the code to do so came after the
first use of "pwd" to set up $GIT_DIR shell variable.

Move the block to define these workaround wrappers, so that everything
everything that executes when the scriptlet is dot-sourced uses the
replacements.

Noticed-by: Ramsay Jones
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-sh-setup.sh: Add an pwd() function for MinGW</title>
<updated>2012-04-18T20:06:19Z</updated>
<author>
<name>Ramsay Jones</name>
<email>ramsay@ramsay1.demon.co.uk</email>
</author>
<published>2012-04-17T18:48:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=be39048a7385157e4b7baabd3e64fe186b428ea1'/>
<id>urn:sha1:be39048a7385157e4b7baabd3e64fe186b428ea1</id>
<content type='text'>
Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Acked-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/parse-date-raw' into maint</title>
<updated>2012-02-13T19:42:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-02-13T19:42:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=87cb3b82a42613dc3ffd1eddf95f8c306a045ad1'/>
<id>urn:sha1:87cb3b82a42613dc3ffd1eddf95f8c306a045ad1</id>
<content type='text'>
* jc/parse-date-raw:
  parse_date(): '@' prefix forces git-timestamp
  parse_date(): allow ancient git-timestamp
</content>
</entry>
<entry>
<title>Merge branch 'jc/parse-date-raw'</title>
<updated>2012-02-10T22:08:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-02-10T22:08:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=3d8bc74127bbb583bc437214a1d6c9afcf77646c'/>
<id>urn:sha1:3d8bc74127bbb583bc437214a1d6c9afcf77646c</id>
<content type='text'>
* jc/parse-date-raw:
  parse_date(): '@' prefix forces git-timestamp
  parse_date(): allow ancient git-timestamp
</content>
</entry>
<entry>
<title>parse_date(): '@' prefix forces git-timestamp</title>
<updated>2012-02-04T07:11:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-02-02T21:41:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=2c733fb24c10a9d7aacc51f956bf9b7881980870'/>
<id>urn:sha1:2c733fb24c10a9d7aacc51f956bf9b7881980870</id>
<content type='text'>
The only place that the issue this series addresses was observed
where we read "cat-file commit" output and put it in GIT_AUTHOR_DATE
in order to replay a commit with an ancient timestamp.

With the previous patch alone, "git commit --date='20100917 +0900'"
can be misinterpreted to mean an ancient timestamp, not September in
year 2010.  Guard this codepath by requring an extra '@' in front of
the raw git timestamp on the parsing side. This of course needs to
be compensated by updating get_author_ident_from_commit and the code
for "git commit --amend" to prepend '@' to the string read from the
existing commit in the GIT_AUTHOR_DATE environment variable.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use -h for synopsis and --help for manpage consistently</title>
<updated>2011-10-05T17:47:10Z</updated>
<author>
<name>Clemens Buchacher</name>
<email>drizzd@aon.at</email>
</author>
<published>2011-10-03T18:21:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=87182b17ed471a7b9cbbc24e1c02f90c8725dc6f'/>
<id>urn:sha1:87182b17ed471a7b9cbbc24e1c02f90c8725dc6f</id>
<content type='text'>
A few scripted Porcelain implementations pretend as if the routine to show
their own help messages are triggered upon "git cmd --help", but a command
line parser of "git" will hijack such a request and shows the manpage for
the cmd subcommand.

Leaving the code to handle such input is simply misleading.

Signed-off-by: Clemens Buchacher &lt;drizzd@aon.at&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-sh-setup: add die_with_status</title>
<updated>2011-06-13T18:23:28Z</updated>
<author>
<name>Fredrik Gustafsson</name>
<email>iveqy@iveqy.com</email>
</author>
<published>2011-06-09T07:47:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=adb231cfdabd9b62c2d99519ac5f8ba29d689478'/>
<id>urn:sha1:adb231cfdabd9b62c2d99519ac5f8ba29d689478</id>
<content type='text'>
This behaves similar to "die" but can exit with status different from the
usual 1.

Signed-off-by: Fredrik Gustafsson &lt;iveqy@iveqy.com&gt;
Mentored-by: Jens Lehmann &lt;Jens.Lehmann@web.de&gt;
Mentored-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</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.stealer.net/cgit.cgi/user/sven/git.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>
</feed>
