<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/environment.c, branch v1.7.3.5</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.7.3.5</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.7.3.5'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2010-11-13T00:03:27Z</updated>
<entry>
<title>setup: make sure git_dir path is in a permanent buffer, getenv(3) case</title>
<updated>2010-11-13T00:03:27Z</updated>
<author>
<name>Kirill Smelkov</name>
<email>kirr@mns.spb.ru</email>
</author>
<published>2010-11-11T18:08:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=15431ca651050ba315fa4e2e74527f6d115e706c'/>
<id>urn:sha1:15431ca651050ba315fa4e2e74527f6d115e706c</id>
<content type='text'>
getenv(3) returns not-permanent buffer which may be changed by e.g.
putenv(3) call (*).

In practice I've noticed this when trying to do `git commit -m abc`
inside msysgit under wine, getting

    $ git commit -m abc
    fatal: could not open 'DIR=.git/COMMIT_EDITMSG': No such file or directory
                           ^^^^
    (notice introduced 'DIR=' artifact.)

The problem was showing itself only with -m option, and actually, as
debugging showed, originally

    git_dir = getenv("GIT_DIR")

returned pointer to

        "GIT_DIR=.git\0"
                 ^
               git_dir

, we stored it in git_dir, than, after processing -m git-commit option,
we did setenv("GIT_EDITOR", ":") which as (*) says changed environment
variables memory layout - something like this

       "...\0GIT_DIR=.git\0"
                 ^
               git_dir

and oops - we got wrong git_dir.

Avoid that by strdupping getenv("GIT_DIR") result like we did in 06f354
(setup: make sure git dir path is in a permanent buffer). Unfortunately
this also shows that other getenv usage inside git needs auditing...

(*) from man 3 getenv:

       The implementation of getenv() is not required to  be  reentrant.   The
       string  pointed  to  by  the return value of getenv() may be statically
       allocated, and can be  modified  by  a  subsequent  call  to  getenv(),
       putenv(3), setenv(3), or unsetenv(3).

Cc: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Kirill Smelkov &lt;kirr@mns.spb.ru&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: make sure git dir path is in a permanent buffer</title>
<updated>2010-10-03T23:50:54Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2010-10-02T08:36:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=06f3549d7146179c5cafe8f76e8fcbc064eba2f7'/>
<id>urn:sha1:06f3549d7146179c5cafe8f76e8fcbc064eba2f7</id>
<content type='text'>
If setup_git_env() is run before the usual repository discovery
sequence and .git is a file with the text

	gitdir: &lt;path&gt;

(with &lt;path&gt; any string) then the in-core git_dir variable is set to
the result of converting &lt;path&gt; to an absolute path using
make_absolute_path().

Unfortunately make_absolute_path() returns its result in a static
buffer that is overwritten by later calls.  Such a call could cause
later accesses to git_dir (from git_pathdup(), for example) to read
the wrong path, leaving git very confused.

It is not obvious whether any existing code in git will trigger the
problem, but in any case, it is worth a few dozen bytes to copy the
return value from make_absolute_path() for some added peace of mind.

Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>environment.c: remove unused variable</title>
<updated>2010-10-03T23:50:54Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2010-10-02T08:35:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=7f7868eadce9b6a9d93e7e8bc80fd58c5e64cc67'/>
<id>urn:sha1:7f7868eadce9b6a9d93e7e8bc80fd58c5e64cc67</id>
<content type='text'>
After v1.6.0-rc0~230^2^ (environment.c: remove unused function,
2008-06-19), git_refs_dir is not used any more.

Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'kf/askpass-config'</title>
<updated>2010-09-08T16:17:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-09-08T16:17:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b815a726e9da97924b44d551b10d3fef3b3d1885'/>
<id>urn:sha1:b815a726e9da97924b44d551b10d3fef3b3d1885</id>
<content type='text'>
* kf/askpass-config:
  Extend documentation of core.askpass and GIT_ASKPASS.
  Allow core.askpass to override SSH_ASKPASS.
  Add a new option 'core.askpass'.
</content>
</entry>
<entry>
<title>Merge branch 'jk/maint-pass-c-config-in-env'</title>
<updated>2010-09-08T16:17:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-09-08T16:17:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6b948a7a480b4ad5e112eb1642e9160e2a3b4f2b'/>
<id>urn:sha1:6b948a7a480b4ad5e112eb1642e9160e2a3b4f2b</id>
<content type='text'>
* jk/maint-pass-c-config-in-env:
  do not pass "git -c foo=bar" params to transport helpers
  pass "git -c foo=bar" params through environment
</content>
</entry>
<entry>
<title>Add a new option 'core.askpass'.</title>
<updated>2010-08-31T17:49:02Z</updated>
<author>
<name>Anselm Kruis</name>
<email>a.kruis@science-computing.de</email>
</author>
<published>2010-08-30T13:38:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d3e7da8979f6ee3edd88fe53241095921d578285'/>
<id>urn:sha1:d3e7da8979f6ee3edd88fe53241095921d578285</id>
<content type='text'>
Setting this option has the same effect as setting the environment variable
'GIT_ASKPASS'.

Signed-off-by: Knut Franke &lt;k.franke@science-computing.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>do not pass "git -c foo=bar" params to transport helpers</title>
<updated>2010-08-24T16:54:00Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2010-08-24T06:41:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=655e8d9c92121b1d84fda91b73c4a0daa638cbf8'/>
<id>urn:sha1:655e8d9c92121b1d84fda91b73c4a0daa638cbf8</id>
<content type='text'>
Like $GIT_CONFIG, $GIT_CONFIG_PARAMETERS needs to be suppressed by
"git push" and its cousins when running local transport helpers to
imitate remote transport well.

Noticed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git wrapper: introduce startup_info struct</title>
<updated>2010-08-11T16:24:00Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2010-08-06T02:40:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e37c1329fa86683c828f04b51bad8bae03939ced'/>
<id>urn:sha1:e37c1329fa86683c828f04b51bad8bae03939ced</id>
<content type='text'>
The startup_info struct will collect information managed by the git
setup code, such as the prefix for relative paths passed on the
command line (i.e., path to the starting cwd from the toplevel of
the work tree) and whether a git repository has been found.

In other words, startup_info is intended to be a collection of global
variables with results that were previously returned from setup
functions.  This state is global anyway (since the cwd is), even
if it is not currently tracked that way.  Letting these values persist
means there is more flexibility in deciding when to run setup.

For now, the struct is empty.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'eb/core-eol'</title>
<updated>2010-06-21T13:02:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-06-21T13:02:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d5cff17edaf438bbf45a2130e9cadc0c938291d6'/>
<id>urn:sha1:d5cff17edaf438bbf45a2130e9cadc0c938291d6</id>
<content type='text'>
* eb/core-eol:
  Add "core.eol" config variable
  Rename the "crlf" attribute "text"
  Add per-repository eol normalization
  Add tests for per-repository eol normalization

Conflicts:
	Documentation/config.txt
	Makefile
</content>
</entry>
<entry>
<title>Add "core.eol" config variable</title>
<updated>2010-06-07T04:20:04Z</updated>
<author>
<name>Eyvind Bernhardsen</name>
<email>eyvind.bernhardsen@gmail.com</email>
</author>
<published>2010-06-04T19:29:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=942e7747678ecf5f118ea5b2d0c763166de21f3a'/>
<id>urn:sha1:942e7747678ecf5f118ea5b2d0c763166de21f3a</id>
<content type='text'>
Introduce a new configuration variable, "core.eol", that allows the user
to set which line endings to use for end-of-line-normalized files in the
working directory.  It defaults to "native", which means CRLF on Windows
and LF everywhere else.

Note that "core.autocrlf" overrides core.eol.  This means that

[core]
	autocrlf = true

puts CRLFs in the working directory even if core.eol is set to "lf".

Signed-off-by: Eyvind Bernhardsen &lt;eyvind.bernhardsen@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
