<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pathspec.c, branch v2.30.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.30.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.30.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-07-31T02:18:06Z</updated>
<entry>
<title>strvec: rename struct fields</title>
<updated>2020-07-31T02:18:06Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-29T00:37:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d70a9eb611a9d242c1d26847d223b8677609305b'/>
<id>urn:sha1:d70a9eb611a9d242c1d26847d223b8677609305b</id>
<content type='text'>
The "argc" and "argv" names made sense when the struct was argv_array,
but now they're just confusing. Let's rename them to "nr" (which we use
for counts elsewhere) and "v" (which is rather terse, but reads well
when combined with typical variable names like "args.v").

Note that we have to update all of the callers immediately. Playing
tricks with the preprocessor is hard here, because we wouldn't want to
rewrite unrelated tokens.

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>strvec: convert remaining callers away from argv_array name</title>
<updated>2020-07-28T22:02:18Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-28T20:25:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f'/>
<id>urn:sha1:c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f</id>
<content type='text'>
We eventually want to drop the argv_array name and just use strvec
consistently. There's no particular reason we have to do it all at once,
or care about interactions between converted and unconverted bits.
Because of our preprocessor compat layer, the names are interchangeable
to the compiler (so even a definition and declaration using different
names is OK).

This patch converts all of the remaining files, as the resulting diff is
reasonably sized.

The conversion was done purely mechanically with:

  git ls-files '*.c' '*.h' |
  xargs perl -i -pe '
    s/ARGV_ARRAY/STRVEC/g;
    s/argv_array/strvec/g;
  '

We'll deal with any indentation/style fallouts separately.

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>strvec: rename files from argv-array to strvec</title>
<updated>2020-07-28T22:02:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-28T20:23:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98'/>
<id>urn:sha1:dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98</id>
<content type='text'>
This requires updating #include lines across the code-base, but that's
all fairly mechanical, and was done with:

  git ls-files '*.c' '*.h' |
  xargs perl -i -pe 's/argv-array.h/strvec.h/'

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>prefix_path: show gitdir if worktree unavailable</title>
<updated>2020-03-15T16:35:46Z</updated>
<author>
<name>Emily Shaffer</name>
<email>emilyshaffer@google.com</email>
</author>
<published>2020-03-03T04:05:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5c20398699165a91af2d81ea2d20385bc8dd3627'/>
<id>urn:sha1:5c20398699165a91af2d81ea2d20385bc8dd3627</id>
<content type='text'>
If there is no worktree at present, we can still hint the user about
Git's current directory by showing them the absolute path to the Git
directory. Even though the Git directory doesn't make it as easy to
locate the worktree in question, it can still help a user figure out
what's going on while developing a script.

This fixes a segmentation fault introduced in e0020b2f
("prefix_path: show gitdir when arg is outside repo", 2020-02-14).

Signed-off-by: Emily Shaffer &lt;emilyshaffer@google.com&gt;
[jc: added minimum tests, with help from Szeder Gábor]
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>prefix_path: show gitdir when arg is outside repo</title>
<updated>2020-02-16T23:32:59Z</updated>
<author>
<name>Emily Shaffer</name>
<email>emilyshaffer@google.com</email>
</author>
<published>2020-02-15T01:00:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e0020b2f82910f50bc697d86aff70c3796fbdc41'/>
<id>urn:sha1:e0020b2f82910f50bc697d86aff70c3796fbdc41</id>
<content type='text'>
When developing a script, it can be painful to understand why Git thinks
something is outside the current repo, if the current repo isn't what
the user thinks it is. Since this can be tricky to diagnose, especially
in cases like submodules or nested worktrees, let's give the user a hint
about which repository is offended about that path.

Signed-off-by: Emily Shaffer &lt;emilyshaffer@google.com&gt;
Acked-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pathspec: add new function to parse file</title>
<updated>2019-11-20T04:01:53Z</updated>
<author>
<name>Alexandr Miloslavskiy</name>
<email>alexandr.miloslavskiy@syntevo.com</email>
</author>
<published>2019-11-19T16:48:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=24e4750c969b844536af1d286e7d977c74c078a2'/>
<id>urn:sha1:24e4750c969b844536af1d286e7d977c74c078a2</id>
<content type='text'>
This will be used to support the new option '--pathspec-from-file' in
`git add`, `git-commit`, `git reset` etc.

Note also that we specifically handle CR/LF line endings to support
Windows better.

To simplify code, file is first parsed into `argv_array`. This allows
to avoid refactoring `parse_pathspec()`.

I considered adding `nul_term_line` to `flags` instead, but decided
that it doesn't fit there.

The new code is mostly taken from `cmd_update_index()` and
`split_mail_conv()`.

Co-authored-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Alexandr Miloslavskiy &lt;alexandr.miloslavskiy@syntevo.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/the-index-final'</title>
<updated>2019-02-07T06:05:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-02-07T06:05:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7589e63648bf5224e186990931b1491f36e10a4b'/>
<id>urn:sha1:7589e63648bf5224e186990931b1491f36e10a4b</id>
<content type='text'>
The assumption to work on the single "in-core index" instance has
been reduced from the library-ish part of the codebase.

* nd/the-index-final:
  cache.h: flip NO_THE_INDEX_COMPATIBILITY_MACROS switch
  read-cache.c: remove the_* from index_has_changes()
  merge-recursive.c: remove implicit dependency on the_repository
  merge-recursive.c: remove implicit dependency on the_index
  sha1-name.c: remove implicit dependency on the_index
  read-cache.c: replace update_index_if_able with repo_&amp;
  read-cache.c: kill read_index()
  checkout: avoid the_index when possible
  repository.c: replace hold_locked_index() with repo_hold_locked_index()
  notes-utils.c: remove the_repository references
  grep: use grep_opt-&gt;repo instead of explict repo argument
</content>
</entry>
<entry>
<title>cache.h: flip NO_THE_INDEX_COMPATIBILITY_MACROS switch</title>
<updated>2019-01-24T19:55:06Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-01-24T08:29:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8adbec9feaa7a1ab9814db1115826e87033712e'/>
<id>urn:sha1:f8adbec9feaa7a1ab9814db1115826e87033712e</id>
<content type='text'>
By default, index compat macros are off from now on, because they
could hide the_index dependency.

Only those in builtin can use 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>dir.c: move, rename and export match_attrs()</title>
<updated>2018-11-19T01:50:33Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-11-18T16:47:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=22af33bece7e121b9d535d0a117cd4553b00fe07'/>
<id>urn:sha1:22af33bece7e121b9d535d0a117cd4553b00fe07</id>
<content type='text'>
The function will be reused for matching attributes in pathspec when
walking trees (currently it's used for matching pathspec when walking
a list). pathspec.c would be a more neutral place for this.

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>pathspec.c: use the right index instead of the_index</title>
<updated>2018-08-13T21:14:43Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-08-13T16:14:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d17ef3a94e6ee33be568c33496a84f15fb5fd4ee'/>
<id>urn:sha1:d17ef3a94e6ee33be568c33496a84f15fb5fd4ee</id>
<content type='text'>
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>
</feed>
