<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pathspec.h, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-08-08T20:23:26Z</updated>
<entry>
<title>pathspec.h: move pathspec_needs_expanded_index() from reset.c to here</title>
<updated>2022-08-08T20:23:26Z</updated>
<author>
<name>Shaoxuan Yuan</name>
<email>shaoxuan.yuan02@gmail.com</email>
</author>
<published>2022-08-07T04:13:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b29ad38322d37925d217314383352c5341422a1c'/>
<id>urn:sha1:b29ad38322d37925d217314383352c5341422a1c</id>
<content type='text'>
Method pathspec_needs_expanded_index() in reset.c from 4d1cfc1351
(reset: make --mixed sparse-aware, 2021-11-29) is reusable when we
need to verify if the index needs to be expanded when the command
is utilizing a pathspec rather than a literal path.

Move it to pathspec.h for reusability.

Add a few items to the function so it can better serve its purpose as
a standalone public function:

* Add a check in front so if the index is not sparse, return early since
  no expansion is needed.

* It now takes an arbitrary 'struct index_state' pointer instead of
  using `the_index` and `active_cache`.

* Add documentation to the function.

Helped-by: Victoria Dye &lt;vdye@github.com&gt;
Helped-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Shaoxuan Yuan &lt;shaoxuan.yuan02@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pathspec: use BUG(...) not die("BUG:%s:%d....", &lt;file&gt;, &lt;line&gt;)</title>
<updated>2021-12-07T20:31:17Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-12-07T11:05:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a78537a0f26615b69b680845cfbb765cc665c808'/>
<id>urn:sha1:a78537a0f26615b69b680845cfbb765cc665c808</id>
<content type='text'>
Change code that was added in 8f4f8f4579f (guard against new pathspec
magic in pathspec matching code, 2013-07-14) to use the BUG() macro
instead of emitting a "fatal" message with the "__FILE__"-name and
"__LINE__"-numbers.

The original code predated the existence of the BUG() function, which
was added in d8193743e08 (usage.c: add BUG() function, 2017-05-12).

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ds/gender-neutral-doc'</title>
<updated>2021-07-17T00:42:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-07-17T00:42:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8e62a85352e998415934ac24c6b0db3cd37d372e'/>
<id>urn:sha1:8e62a85352e998415934ac24c6b0db3cd37d372e</id>
<content type='text'>
Update the documentation not to assume users are of certain gender
and adds to guidelines to do so.

* ds/gender-neutral-doc:
  *: fix typos
  comments: avoid using the gender of our users
  doc: avoid using the gender of other people
</content>
</entry>
<entry>
<title>comments: avoid using the gender of our users</title>
<updated>2021-06-16T02:25:11Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-06-15T14:11:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0e20b229eea63716cdd1bea916b7e416f450278a'/>
<id>urn:sha1:0e20b229eea63716cdd1bea916b7e416f450278a</id>
<content type='text'>
We generally avoid specifying the gender of our users in order to be
more inclusive, but sometimes a few slip by due to habit.

Since by doing a little bit of rewording we can avoid this irrelevant
detail, let's do so.

Inspired-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Helped-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mt/add-rm-in-sparse-checkout'</title>
<updated>2021-05-07T03:47:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-05-07T03:47:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe069dce6251f40eb3d54861500c92afb0e481d9'/>
<id>urn:sha1:fe069dce6251f40eb3d54861500c92afb0e481d9</id>
<content type='text'>
"git add" and "git rm" learned not to touch those paths that are
outside of sparse checkout.

* mt/add-rm-in-sparse-checkout:
  rm: honor sparse checkout patterns
  add: warn when asked to update SKIP_WORKTREE entries
  refresh_index(): add flag to ignore SKIP_WORKTREE entries
  pathspec: allow to ignore SKIP_WORKTREE entries on index matching
  add: make --chmod and --renormalize honor sparse checkouts
  t3705: add tests for `git add` in sparse checkouts
  add: include magic part of pathspec on --refresh error
</content>
</entry>
<entry>
<title>*: remove 'const' qualifier for struct index_state</title>
<updated>2021-04-14T20:46:00Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2021-04-01T01:49:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=847a9e5d4f876646e128c89f0818b1a8ce792509'/>
<id>urn:sha1:847a9e5d4f876646e128c89f0818b1a8ce792509</id>
<content type='text'>
Several methods specify that they take a 'struct index_state' pointer
with the 'const' qualifier because they intend to only query the data,
not change it. However, we will be introducing a step very low in the
method stack that might modify a sparse-index to become a full index in
the case that our queries venture inside a sparse-directory entry.

This change only removes the 'const' qualifiers that are necessary for
the following change which will actually modify the implementation of
index_name_stage_pos().

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add: warn when asked to update SKIP_WORKTREE entries</title>
<updated>2021-04-08T21:18:03Z</updated>
<author>
<name>Matheus Tavares</name>
<email>matheus.bernardino@usp.br</email>
</author>
<published>2021-04-08T20:41:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a20f70478ffcc66d30936920ebcc35ebfc12a7c7'/>
<id>urn:sha1:a20f70478ffcc66d30936920ebcc35ebfc12a7c7</id>
<content type='text'>
`git add` already refrains from updating SKIP_WORKTREE entries, but it
silently exits with zero code when it is asked to do so. Instead, let's
warn the user and display a hint on how to update these entries.

Note that we only warn the user whey they give a pathspec item that
matches no eligible path for updating, but it does match one or more
SKIP_WORKTREE entries. A warning was chosen over erroring out right away
to reproduce the same behavior `add` already exhibits with ignored
files. This also allow users to continue their workflow without having
to invoke `add` again with only the eligible paths (as those will have
already been added).

Signed-off-by: Matheus Tavares &lt;matheus.bernardino@usp.br&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pathspec: allow to ignore SKIP_WORKTREE entries on index matching</title>
<updated>2021-04-08T21:18:03Z</updated>
<author>
<name>Matheus Tavares</name>
<email>matheus.bernardino@usp.br</email>
</author>
<published>2021-04-08T20:41:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=719630eb4826ff7f36bc060533dbccc3c96d151c'/>
<id>urn:sha1:719630eb4826ff7f36bc060533dbccc3c96d151c</id>
<content type='text'>
Add a new enum parameter to `add_pathspec_matches_against_index()` and
`find_pathspecs_matching_against_index()`, allowing callers to specify
whether these function should attempt to match SKIP_WORKTREE entries or
not. This will be used in a future patch to make `git add` display a
warning when it is asked to update SKIP_WORKTREE entries.

Signed-off-by: Matheus Tavares &lt;matheus.bernardino@usp.br&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'hw/doc-in-header'</title>
<updated>2019-12-16T21:08:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-12-16T21:08:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=26c816a67de449b3c5284ab97b03aeeeeabbb45c'/>
<id>urn:sha1:26c816a67de449b3c5284ab97b03aeeeeabbb45c</id>
<content type='text'>
* hw/doc-in-header:
  trace2: move doc to trace2.h
  submodule-config: move doc to submodule-config.h
  tree-walk: move doc to tree-walk.h
  trace: move doc to trace.h
  run-command: move doc to run-command.h
  parse-options: add link to doc file in parse-options.h
  credential: move doc to credential.h
  argv-array: move doc to argv-array.h
  cache: move doc to cache.h
  sigchain: move doc to sigchain.h
  pathspec: move doc to pathspec.h
  revision: move doc to revision.h
  attr: move doc to attr.h
  refs: move doc to refs.h
  remote: move doc to remote.h and refspec.h
  sha1-array: move doc to sha1-array.h
  merge: move doc to ll-merge.h
  graph: move doc to graph.h and graph.c
  dir: move doc to dir.h
  diff: move doc to diff.h and diffcore.h
</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>
</feed>
