<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/dir.c, branch v2.3.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.7</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-03-31T21:53:08Z</updated>
<entry>
<title>Merge branch 'jc/report-path-error-to-dir' into maint</title>
<updated>2015-03-31T21:53:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-31T21:53:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ab0fb57aac6c5b6f074c07c7e2729bcff58cc45d'/>
<id>urn:sha1:ab0fb57aac6c5b6f074c07c7e2729bcff58cc45d</id>
<content type='text'>
Code clean-up.

* jc/report-path-error-to-dir:
  report_path_error(): move to dir.c
</content>
</entry>
<entry>
<title>report_path_error(): move to dir.c</title>
<updated>2015-03-24T21:12:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-24T21:12:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=777c55a61615837d4391facd75cf334b96635801'/>
<id>urn:sha1:777c55a61615837d4391facd75cf334b96635801</id>
<content type='text'>
The expected call sequence is for the caller to use match_pathspec()
repeatedly on a set of pathspecs, accumulating the "hits" in a
separate array, and then call this function to diagnose a pathspec
that never matched anything, as that can indicate a typo from the
command line, e.g. "git commit Maekfile".

Many builtin commands use this function from builtin/ls-files.c,
which is not a very healthy arrangement.  ls-files might have been
the first command to feel the need for such a helper, but the need
is shared by everybody who uses the "match and then report" pattern.

Move it to dir.c where match_pathspec() is defined.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/dir-prep-exclude-cleanup'</title>
<updated>2014-10-24T22:00:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-24T22:00:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1758d236a253c10f34ae16cd2ae6d9c57eb312a7'/>
<id>urn:sha1:1758d236a253c10f34ae16cd2ae6d9c57eb312a7</id>
<content type='text'>
Code clean-up.

* nd/dir-prep-exclude-cleanup:
  dir.c: remove the second declaration of "stk" in prep_exclude()
</content>
</entry>
<entry>
<title>dir.c: remove the second declaration of "stk" in prep_exclude()</title>
<updated>2014-10-21T18:22:00Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-10-21T11:38:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=03e11a715bffb0715ebcc9d6370aac7b968b3a4a'/>
<id>urn:sha1:03e11a715bffb0715ebcc9d6370aac7b968b3a4a</id>
<content type='text'>
This "stk" shadows the first declaration at the top. There's currently
no bad effect. But let's avoid it.

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;
</content>
</entry>
<entry>
<title>Merge branch 'rs/strbuf-getcwd'</title>
<updated>2014-09-02T20:28:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-02T20:27:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f655651e09b9fa7bf8ff13f1b4a5b16c7956e4cf'/>
<id>urn:sha1:f655651e09b9fa7bf8ff13f1b4a5b16c7956e4cf</id>
<content type='text'>
Reduce the use of fixed sized buffer passed to getcwd() calls
by introducing xgetcwd() helper.

* rs/strbuf-getcwd:
  use strbuf_add_absolute_path() to add absolute paths
  abspath: convert absolute_path() to strbuf
  use xgetcwd() to set $GIT_DIR
  use xgetcwd() to get the current directory or die
  wrapper: add xgetcwd()
  abspath: convert real_path_internal() to strbuf
  abspath: use strbuf_getcwd() to remember original working directory
  setup: convert setup_git_directory_gently_1 et al. to strbuf
  unix-sockets: use strbuf_getcwd()
  strbuf: add strbuf_getcwd()
</content>
</entry>
<entry>
<title>use xgetcwd() to get the current directory or die</title>
<updated>2014-08-26T18:06:06Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-07-28T18:30:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=56b9f6e738af6f5238f57a29e96103cf61e3f8cd'/>
<id>urn:sha1:56b9f6e738af6f5238f57a29e96103cf61e3f8cd</id>
<content type='text'>
Convert several calls of getcwd() and die() to use xgetcwd() instead.
This way we get rid of fixed-size buffers (which can be too small
depending on the used file system) and gain consistent error messages.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>prep_exclude: remove the artificial PATH_MAX limit</title>
<updated>2014-07-14T22:24:34Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-07-14T09:50:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aceb9429b37a4a36e91f9eeb60e7ba488f73604b'/>
<id>urn:sha1:aceb9429b37a4a36e91f9eeb60e7ba488f73604b</id>
<content type='text'>
This fixes a segfault in git-status with long paths on Windows,
where PATH_MAX is only 260.

This also fixes the problem of silently ignoring .gitignore if the
full path exceeds PATH_MAX. Now add_excludes_from_file() will report
if it gets ENAMETOOLONG.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Karsten Blees &lt;blees@dcon.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir.c: coding style fix</title>
<updated>2014-07-14T22:24:34Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-07-14T09:47:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d961baa84689afdd0fe6b81f68b06481d83ce249'/>
<id>urn:sha1:d961baa84689afdd0fe6b81f68b06481d83ce249</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Karsten Blees &lt;blees@dcon.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cleanup duplicate name_compare() functions</title>
<updated>2014-06-20T17:12:14Z</updated>
<author>
<name>Jeremiah Mahler</name>
<email>jmmahler@gmail.com</email>
</author>
<published>2014-06-20T02:06:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ccdd4a0f3c7c550526a980e93156f25a956497bc'/>
<id>urn:sha1:ccdd4a0f3c7c550526a980e93156f25a956497bc</id>
<content type='text'>
We often represent our strings as a counted string, i.e. a pair of
the pointer to the beginning of the string and its length, and the
string may not be NUL terminated to that length.

To compare a pair of such counted strings, unpack-trees.c and
read-cache.c implement their own name_compare() functions
identically.  In addition, the cache_name_compare() function in
read-cache.c is nearly identical.  The only difference is when one
string is the prefix of the other string, in which case
name_compare() returns -1/+1 to show which one is longer, and
cache_name_compare() returns the difference of the lengths to show
the same information.

Unify these three functions by using the implementation from
cache_name_compare().  This does not make any difference to the
existing and future callers, as they must be paying attention only
to the sign of the returned value (and not the magnitude) because
the original implementations of these two functions return values
returned by memcmp(3) when the one string is not a prefix of the
other string, and the only thing memcmp(3) guarantees its callers is
the sign of the returned value, not the magnitude.

Signed-off-by: Jeremiah Mahler &lt;jmmahler@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir.c:trim_trailing_spaces(): fix for " \ " sequence</title>
<updated>2014-06-02T22:48:48Z</updated>
<author>
<name>Pasha Bolokhov</name>
<email>pasha.bolokhov@gmail.com</email>
</author>
<published>2014-06-02T22:36:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e61a6c1d8272f9d7bdc861ed28bfac5fb7e33556'/>
<id>urn:sha1:e61a6c1d8272f9d7bdc861ed28bfac5fb7e33556</id>
<content type='text'>
Discard the unnecessary 'nr_spaces' variable, remove 'strlen()' and
improve the 'if' structure.  Switch to pointers instead of integers
to control the loop.

Slightly more rare occurrences of 'text  \    ' with a backslash
in between spaces are handled correctly.  Namely, the code in
7e2e4b37 (dir: ignore trailing spaces in exclude patterns, 2014-02-09)
does not reset 'last_space' when a backslash is encountered and the above
line stays intact as a result.

Add a test at the end of t/t0008-ignores.sh to exhibit this behavior.

Signed-off-by: Pasha Bolokhov &lt;pasha.bolokhov@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
