<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t7526-commit-pathspec-file.sh, branch v2.26.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.26.1</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.26.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-01-30T22:17:08Z</updated>
<entry>
<title>Merge branch 'am/test-pathspec-f-f-error-cases'</title>
<updated>2020-01-30T22:17:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-01-30T22:17:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=96aef8f68404964c48d0d85ce04f6b2d84097246'/>
<id>urn:sha1:96aef8f68404964c48d0d85ce04f6b2d84097246</id>
<content type='text'>
More tests.

* am/test-pathspec-f-f-error-cases:
  t: add tests for error conditions with --pathspec-from-file
</content>
</entry>
<entry>
<title>t: fix quotes tests for --pathspec-from-file</title>
<updated>2020-01-15T20:14:20Z</updated>
<author>
<name>Alexandr Miloslavskiy</name>
<email>alexandr.miloslavskiy@syntevo.com</email>
</author>
<published>2019-12-31T10:15:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=568cabb2fed8e5e61057ac678a70a565dffd0763'/>
<id>urn:sha1:568cabb2fed8e5e61057ac678a70a565dffd0763</id>
<content type='text'>
While working on the next patch, I also noticed that quotes testing via
`"\"file\\101.t\""` was somewhat incorrect: I escaped `\` one time while
I had to escape it two times! Tests still worked due to `"` being
preserved which in turn prevented pathspec from matching files.

Fix this by using here-doc instead.

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>t: add tests for error conditions with --pathspec-from-file</title>
<updated>2020-01-15T20:14:15Z</updated>
<author>
<name>Alexandr Miloslavskiy</name>
<email>alexandr.miloslavskiy@syntevo.com</email>
</author>
<published>2019-12-30T15:38:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f94f7bd00d06c6b651a0e7afcc90ac86cc5f391b'/>
<id>urn:sha1:f94f7bd00d06c6b651a0e7afcc90ac86cc5f391b</id>
<content type='text'>
Also move some old tests into the new tests: it doesn't seem reasonable
to have individual error condition tests.

Old test for `git commit` was corrected, previously it was instructed
to use stdin but wasn't provided with any stdin. While this works at
the moment, it's not exactly perfect.

Old tests for `git reset` were improved to test for a specific error
message.

Suggested-By: Phillip Wood &lt;phillip.wood@dunelm.org.uk&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>commit: forbid --pathspec-from-file --all</title>
<updated>2019-12-18T22:14:14Z</updated>
<author>
<name>Alexandr Miloslavskiy</name>
<email>alexandr.miloslavskiy@syntevo.com</email>
</author>
<published>2019-12-16T15:47:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=509efef789de51f5d68e5c9799918f9a5ea09670'/>
<id>urn:sha1:509efef789de51f5d68e5c9799918f9a5ea09670</id>
<content type='text'>
I forgot this in my previous patch `--pathspec-from-file` for
`git commit` [1]. When both `--pathspec-from-file` and `--all` were
specified, `--all` took precedence and `--pathspec-from-file` was
ignored. Before `--pathspec-from-file` was implemented, this case was
prevented by this check in `parse_and_validate_options()` :

    die(_("paths '%s ...' with -a does not make sense"), argv[0]);

It is unfortunate that these two cases are disconnected. This came as
result of how the code was laid out before my patches, where `pathspec`
is parsed outside of `parse_and_validate_options()`. This branch is
already full of refactoring patches and I did not dare to go for another
one.

Fix by mirroring `die()` for `--pathspec-from-file` as well.

[1] Commit e440fc58 ("commit: support the --pathspec-from-file option" 2019-11-19)

Reported-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&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>commit: support the --pathspec-from-file option</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:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e440fc5888bd5faf1775fc61621caa3c5fab96b6'/>
<id>urn:sha1:e440fc5888bd5faf1775fc61621caa3c5fab96b6</id>
<content type='text'>
Decisions taken for simplicity:
1) For now, `--pathspec-from-file` is declared incompatible with
   `--interactive/--patch`, even when &lt;file&gt; is not `stdin`. Such use
   case it not really expected. Also, it would require changes to
   `interactive_add()`.
2) It is not allowed to pass pathspec in both args and file.

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>
