-
Notifications
You must be signed in to change notification settings - Fork 144
Add --pathspec-from-file
option
#445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --pathspec-from-file
option
#445
Conversation
/submit |
Submitted as [email protected] |
@@ -13,7 +13,7 @@ SYNOPSIS | |||
[-F <file> | -m <msg>] [--reset-author] [--allow-empty] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Junio C Hamano wrote (reply to this):
"Alexandr Miloslavskiy via GitGitGadget" <[email protected]>
writes:
> From: Alexandr Miloslavskiy <[email protected]>
>
> Synchronize it to `git add`, which has a pretty good description.
> This also better disambiguates <file>... header.
"When files are given on..." is no longer true with this change (it
wasn't true with the code before this change anyway).
When pathspec is given on the command line, commit the
contents of the files that match the pathspec without
recording the changes already added to the index. ...
The second sentence also says "these files", but that can be left
as-is, since it would refer to "the files that match ..." explained
in the above sentence.
> +For more details about the <pathspec> syntax, see the 'pathspec' entry
> +in linkgit:gitglossary[7].
I am not sure if we want to repeat this all over the place.
We do not say "For details about the <commit> syntax, see the
'SPECIFYING REVISIONS' section of linkgit:git-rev-parse[1]" for
every command that takes <commit> from the command line.
Is your urge to suggest adding this sentence coming from that you
are much more familiar with <commit> than <pathspec>? In other
words, if you were more familiar with Git, would you still be adding
this (and not corresponding one for <commit>)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Alexandr Miloslavskiy wrote (reply to this):
I think I have implemented most suggestions in PatchV2. Thanks!
> I am not sure if we want to repeat this all over the place.
>
> We do not say "For details about the <commit> syntax, see the
> 'SPECIFYING REVISIONS' section of linkgit:git-rev-parse[1]" for
> every command that takes <commit> from the command line.
>
> Is your urge to suggest adding this sentence coming from that you
> are much more familiar with <commit> than <pathspec>? In other
> words, if you were more familiar with Git, would you still be adding
> this (and not corresponding one for <commit>)?
Commit is a well known term, dating from ancient times like CVS or even
older.
Pathspec, however, is something new. When I pretend to be someone new to
git, I see it this way:
1) Let's read "git commit" documentation
2) Where on this commandline do I put my filename?!
So yes, I would repeat it in every location that could be popular for
new users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Junio C Hamano wrote (reply to this):
Alexandr Miloslavskiy <[email protected]> writes:
> I think I have implemented most suggestions in PatchV2. Thanks!
>
>> I am not sure if we want to repeat this all over the place.
>>
>> We do not say "For details about the <commit> syntax, see the
>> 'SPECIFYING REVISIONS' section of linkgit:git-rev-parse[1]" for
>> every command that takes <commit> from the command line.
>>
>> Is your urge to suggest adding this sentence coming from that you
>> are much more familiar with <commit> than <pathspec>? In other
>> words, if you were more familiar with Git, would you still be adding
>> this (and not corresponding one for <commit>)?
>
> Commit is a well known term, dating from ancient times like CVS or
> even older.
That's more or less irrelevant.
I am reacting to this from your change that you omitted quoting in
your reply:
> +For more details about the <pathspec> syntax, see the 'pathspec' entry
> +in linkgit:gitglossary[7].
That sentence is for those who have some notion of <pathspec> but
does not know enough about its syntax.
CVS does not let you specify <commit> like "master^{/^fix frotz}~4";
A user a user who is familiar with CVS's commits would still want to
refer to the section "For details about the <commit> syntax".
I am not advocating to add the reference to SPECIFYING REVISIONS
section; instead we should let readers know that every time they see
<defined word>, they can refer to the glossary for more details.
> Pathspec, however, is something new.
Compared to CVS, everything in Git may be new, but that was a news
in 2010, not this year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Alexandr Miloslavskiy wrote (reply to this):
On 07.11.2019 6:54, Junio C Hamano wrote:
> I am reacting to this from your change that you omitted quoting in
> your reply:
>
>> +For more details about the <pathspec> syntax, see the 'pathspec' entry
>> +in linkgit:gitglossary[7].
>
> That sentence is for those who have some notion of <pathspec> but
> does not know enough about its syntax.
In the perfect world, I would expect _every_ 'pathspec' word in text to
be an HTML-style link to a dedicated article, not just a paragraph in
glossary.
MSDN is in general a good example [1]: there, it's easy to read only a
small portion of article, ignoring anything you're not interested in,
and still have all links at hand.
Regarding dedicated page: the content of 'pathspec' in glossary is
already long enough for a page, and it could benefit from additional
examples. Also, having a dedicated page makes linking easier, so that
user doesn't have to scroll glossary.
Regarding links: I don't really understand what git's doc format allows.
Is it just pure text in worst (or even average) case?
If it's usually something with clickable links, it could be worth to
just insert links everywhere.
If it's usually plaintext, then "see the 'pathspec' entry in
linkgit:gitglossary[7]" is a bit too verbose to repeat on every
occasion. Still, I'd like to see links everywhere. One big reason is to
let reader know that the explanation actually exists!
A compromise solution is to give every article header like this:
This article uses the following terms which are explained
in linkgit:gitglossary[7]:
* pathspec
* tree-ish
* refspec
If it's close to top of article, then chances are that everyone will
notice it. Also, it will not require extra verbosity in plaintext.
> CVS does not let you specify <commit> like "master^{/^fix frotz}~4";
> A user a user who is familiar with CVS's commits would still want to
> refer to the section "For details about the <commit> syntax".
>
> I am not advocating to add the reference to SPECIFYING REVISIONS
> section; instead we should let readers know that every time they see
> <defined word>, they can refer to the glossary for more details.
I now think that my arguments apply to <pathspec> AND <commit> in the
same way. Indeed a user can't know complex <commit> variants until
he/she reads it in git docs.
----
[1]
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea
f484704
to
cb5fc9b
Compare
/submit |
Submitted as [email protected] |
This branch is now known as |
This patch series was integrated into pu via git@13376d9. |
This patch series was integrated into pu via git@66797f9. |
This patch series was integrated into pu via git@f5ab9af. |
This patch series was integrated into pu via git@5ad7d3f. |
This patch series was integrated into pu via git@7126fe7. |
This patch series was integrated into pu via git@eb1041e. |
This patch series was integrated into pu via git@df7e54e. |
This patch series was integrated into pu via git@b8a68d8. |
This patch series was integrated into pu via git@cfdb1c8. |
This patch series was integrated into pu via git@a096466. |
This patch series was integrated into pu via git@49ff8fa. |
This patch series was integrated into pu via git@3618ed0. |
`git add` shows an example of good writing, follow it. Signed-off-by: Alexandr Miloslavskiy <[email protected]>
`git add` shows an example of good writing, follow it. Signed-off-by: Alexandr Miloslavskiy <[email protected]>
Decisions taken for simplicity: 1) For now, `--pathspec-from-file` is declared incompatible with `--patch`, even when <file> is not `stdin`. Such use case it not really expected. 2) It is not allowed to pass pathspec in both args and file. `you must specify path(s) to restore` block was moved down to be able to test for `pathspec.nr` instead, because testing for `argc` is no longer correct. `git switch` does not support the new options because it doesn't expect `<pathspec>` arguments. Signed-off-by: Alexandr Miloslavskiy <[email protected]>
dacf32b
to
c4dd4ea
Compare
--pathspec-from-file
option for reset, commit--pathspec-from-file
option
/submit |
Submitted as [email protected] |
/preview |
Preview email sent as [email protected] |
/preview |
Preview email sent as [email protected] |
/preview |
Preview email sent as [email protected] |
/preview |
Preview email sent as [email protected] |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Alexandr Miloslavskiy wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Alexandr Miloslavskiy wrote (reply to this):
|
This patch series was integrated into pu via git@0effd37. |
This branch is now known as |
This patch series was integrated into pu via git@d41dec3. |
This patch series was integrated into pu via git@57a8519. |
This patch series was integrated into pu via git@d288834. |
This patch series was integrated into pu via git@64df397. |
This patch series was integrated into pu via git@d96bb8b. |
This patch series was integrated into next via git@6b018bd. |
Closing this PR: first part was merged into master now (see git @ c58ae96). |
Cc: Junio C Hamano [email protected]
Cc: Phillip Wood [email protected]