<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/cache.h, branch gitk-resize-error</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=gitk-resize-error</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=gitk-resize-error'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2022-01-12T23:11:43Z</updated>
<entry>
<title>Merge branch 'ma/header-dup-cleanup'</title>
<updated>2022-01-12T23:11:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-01-12T23:11:43Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=453cef74556652c5ecdc840744fa352005bb3152'/>
<id>urn:sha1:453cef74556652c5ecdc840744fa352005bb3152</id>
<content type='text'>
Code clean-up.

* ma/header-dup-cleanup:
  cache.h: drop duplicate `ensure_full_index()` declaration
</content>
</entry>
<entry>
<title>cache.h: drop duplicate `ensure_full_index()` declaration</title>
<updated>2022-01-10T19:30:33Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2022-01-10T18:41:34Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=97d6fb5a1f5c854d87fd3fd98722c469a9195a46'/>
<id>urn:sha1:97d6fb5a1f5c854d87fd3fd98722c469a9195a46</id>
<content type='text'>
There are two identical declarations of `ensure_full_index()` in
cache.h.

Commit 3964fc2aae ("sparse-index: add guard to ensure full index",
2021-03-30) provided an empty implementation of `ensure_full_index()`,
declaring it in a new file sparse-index.h. When commit 4300f8442a
("sparse-index: implement ensure_full_index()", 2021-03-30) fleshed out
the implementation, it added an identical declaration to cache.h.

Then 118a2e8bde ("cache: move ensure_full_index() to cache.h",
2021-04-01) favored having the declaration in cache.h. Because of the
double declaration, at that point we could have just dropped the one in
sparse-index.h, but instead it got moved to cache.h.

As a result, cache.h contains the exact same function declaration twice.
Drop the one under "/* Name hashing */", in favor of the one under
"/* Initialize and use the cache information */".

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Acked-by: Victoria Dye &lt;vdye@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'en/keep-cwd'</title>
<updated>2022-01-05T22:01:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-01-05T22:01:28Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=da81d473fcfa67dfbcf0504d2b5225885e51e532'/>
<id>urn:sha1:da81d473fcfa67dfbcf0504d2b5225885e51e532</id>
<content type='text'>
Many git commands that deal with working tree files try to remove a
directory that becomes empty (i.e. "git switch" from a branch that
has the directory to another branch that does not would attempt
remove all files in the directory and the directory itself).  This
drops users into an unfamiliar situation if the command was run in
a subdirectory that becomes subject to removal due to the command.
The commands have been taught to keep an empty directory if it is
the directory they were started in to avoid surprising users.

* en/keep-cwd:
  t2501: simplify the tests since we can now assume desired behavior
  dir: new flag to remove_dir_recurse() to spare the original_cwd
  dir: avoid incidentally removing the original_cwd in remove_path()
  stash: do not attempt to remove startup_info-&gt;original_cwd
  rebase: do not attempt to remove startup_info-&gt;original_cwd
  clean: do not attempt to remove startup_info-&gt;original_cwd
  symlinks: do not include startup_info-&gt;original_cwd in dir removal
  unpack-trees: add special cwd handling
  unpack-trees: refuse to remove startup_info-&gt;original_cwd
  setup: introduce startup_info-&gt;original_cwd
  t2501: add various tests for removing the current working directory
</content>
</entry>
<entry>
<title>Merge branch 'ew/test-wo-fsync'</title>
<updated>2021-12-15T17:39:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-12-15T17:39:51Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=63a2e8b41e478a86fd98f86fe67b6f6d5b15f8cf'/>
<id>urn:sha1:63a2e8b41e478a86fd98f86fe67b6f6d5b15f8cf</id>
<content type='text'>
Allow running our tests while disabling fsync.

* ew/test-wo-fsync:
  tests: disable fsync everywhere
</content>
</entry>
<entry>
<title>Merge branch 'vd/sparse-reset'</title>
<updated>2021-12-10T22:35:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-12-10T22:35:12Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f0850875fd44a58cd1eae349244327b2eff29fa7'/>
<id>urn:sha1:f0850875fd44a58cd1eae349244327b2eff29fa7</id>
<content type='text'>
Various operating modes of "git reset" have been made to work
better with the sparse index.

* vd/sparse-reset:
  unpack-trees: improve performance of next_cache_entry
  reset: make --mixed sparse-aware
  reset: make sparse-aware (except --mixed)
  reset: integrate with sparse index
  reset: expand test coverage for sparse checkouts
  sparse-index: update command for expand/collapse test
  reset: preserve skip-worktree bit in mixed reset
  reset: rename is_missing to !is_in_reset_tree
</content>
</entry>
<entry>
<title>setup: introduce startup_info-&gt;original_cwd</title>
<updated>2021-12-09T21:33:12Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-12-09T05:08:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=e6f8861bd43636b27651150e6a3caa0a937fb418'/>
<id>urn:sha1:e6f8861bd43636b27651150e6a3caa0a937fb418</id>
<content type='text'>
Removing the current working directory causes all subsequent git
commands run from that directory to get confused and fail with a message
about being unable to read the current working directory:

    $ git status
    fatal: Unable to read current working directory: No such file or directory

Non-git commands likely have similar warnings or even errors, e.g.

    $ bash -c 'echo hello'
    shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    hello

This confuses end users, particularly since the command they get the
error from is not the one that caused the problem; the problem came from
the side-effect of some previous command.

We would like to avoid removing the current working directory of our
parent process; towards this end, introduce a new variable,
startup_info-&gt;original_cwd, that tracks the current working directory
that we inherited from our parent process.  For convenience of later
comparisons, we prefer that this new variable store a path relative to
the toplevel working directory (thus much like 'prefix'), except without
the trailing slash.

Subsequent commits will make use of this new variable.

Acked-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Acked-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reset: make sparse-aware (except --mixed)</title>
<updated>2021-11-29T20:51:26Z</updated>
<author>
<name>Victoria Dye</name>
<email>vdye@github.com</email>
</author>
<published>2021-11-29T15:52:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=20ec2d034cda1afef15a4dcc6e275d7a69413510'/>
<id>urn:sha1:20ec2d034cda1afef15a4dcc6e275d7a69413510</id>
<content type='text'>
Remove `ensure_full_index` guard on `prime_cache_tree` and update
`prime_cache_tree_rec` to correctly reconstruct sparse directory entries in
the cache tree. While processing a tree's entries, `prime_cache_tree_rec`
must determine whether a directory entry is sparse or not by searching for
it in the index (*without* expanding the index). If a matching sparse
directory index entry is found, no subtrees are added to the cache tree
entry and the entry count is set to 1 (representing the sparse directory
itself). Otherwise, the tree is assumed to not be sparse and its subtrees
are recursively added to the cache tree.

Helped-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Victoria Dye &lt;vdye@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>strbuf_addftime(): handle "%s" manually</title>
<updated>2021-11-04T19:38:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2021-11-02T11:35:34Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=9b591b94038ce8cab9baf66a83ad752824854163'/>
<id>urn:sha1:9b591b94038ce8cab9baf66a83ad752824854163</id>
<content type='text'>
The strftime() function has a non-standard "%s" extension, which prints
the number of seconds since the epoch. But the "struct tm" we get has
already been adjusted for a particular time zone; going back to an epoch
time requires knowing that zone offset. Since strftime() doesn't take
such an argument, round-tripping to a "struct tm" and back to the "%s"
format may produce the wrong value (off by tz_offset seconds).

Since we're already passing in the zone offset courtesy of c3fbf81a85
(strbuf: let strbuf_addftime handle %z and %Z itself, 2017-06-15), we
can use that same value to adjust our epoch seconds accordingly.

Note that the description above makes it sound like strftime()'s "%s" is
useless (and really, the issue is shared by mktime(), which is what
strftime() would use under the hood). But it gets the two cases for
which it's designed correct:

  - the result of gmtime() will have a zero offset, so no adjustment is
    necessary

  - the result of localtime() will be offset by the local zone offset,
    and mktime() and strftime() are defined to assume this offset when
    converting back (there's actually some magic here; some
    implementations record this in the "struct tm", but we can't
    portably access or manipulate it. But they somehow "know" whether a
    "struct tm" is from gmtime() or localtime()).

This latter point means that "format-local:%s" actually works correctly
already, because in that case we rely on the system routines due to
6eced3ec5e (date: use localtime() for "-local" time formats,
2017-06-15). Our problem comes when trying to show times in the author's
zone, as the system routines provide no mechanism for converting in
non-local zones. So in those cases we have a "struct tm" that came from
gmtime(), but has been manipulated according to our offset.

The tests cover the broken round-trip by formatting "%s" for a time in a
non-system timezone. We use the made-up "+1234" here, which has two
advantages. One, we know it won't ever be the real system zone (and so
we're actually testing a case that would break). And two, since it has a
minute component, we're testing the full decoding of the +HHMM zone into
a number of seconds. Likewise, we test the "-1234" variant to make sure
there aren't any sign mistakes.

There's one final test, which covers "format-local:%s". As noted, this
already passes, but it's important to check that we didn't regress this
case. In particular, the caller in show_date() is relying on localtime()
to have done the zone adjustment, independent of any tz_offset we
compute ourselves. These should match up, since our local_tzoffset() is
likewise built around localtime(). But it would be easy for a caller to
forget to pass in a correct tz_offset to strbuf_addftime(). Fortunately
show_date() does this correctly (it has to because of the existing
handling of %z), and the test continues to pass. So this one is just
future-proofing against a change in our assumptions.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests: disable fsync everywhere</title>
<updated>2021-10-29T17:22:40Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2021-10-29T00:15:52Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=412e4caee387d825903bf1252aefbd5cf995a599'/>
<id>urn:sha1:412e4caee387d825903bf1252aefbd5cf995a599</id>
<content type='text'>
The "GIT_TEST_FSYNC" environment variable now exists for
disabling fsync() even on packfiles and other "critical" data.

Running "make test -j8 NO_SVN_TESTS=1" on a noisy 8-core system
on an HDD, test runtime drops from ~4 minutes down to ~3 minutes.
Using "GIT_TEST_FSYNC=1" re-enables fsync() for comparison
purposes.

SVN interopability tests are minimally affected since SVN will
still use fsync in various places.

This will also be useful for 3rd-party tools which create
throwaway git repositories of temporary data, but remains
undocumented for end users.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/fix-commit-error-message-upon-unwritable-object-store'</title>
<updated>2021-10-25T23:06:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-25T23:06:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2c428e4205a50cee19669d5b73cc149ec2254a5d'/>
<id>urn:sha1:2c428e4205a50cee19669d5b73cc149ec2254a5d</id>
<content type='text'>
"git commit" gave duplicated error message when the object store
was unwritable, which has been corrected.

* ab/fix-commit-error-message-upon-unwritable-object-store:
  commit: fix duplication regression in permission error output
  unwritable tests: assert exact error output
</content>
</entry>
</feed>
