Skip to content
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

git touch with multiple filenames does not work as expected #467

Closed
al-the-x opened this issue Oct 13, 2015 · 6 comments
Closed

git touch with multiple filenames does not work as expected #467

al-the-x opened this issue Oct 13, 2015 · 6 comments

Comments

@al-the-x
Copy link
Contributor

Little gotcha:

$> git touch A B
$> git status -s
A  A B

WTF? Internally, the git-touch script uses filename="$*" and touch "$filename", which turns the argument list A B into "A B": a single file named "A B" not two files named A and B).

Patch / PR accepted?

@al-the-x
Copy link
Contributor Author

I ask because I've already fixed for my usage, but I'd like to contribute that upstream.

@qw3rtman
Copy link
Collaborator

From man bash, under the section "Special Parameters":

  • $* is equivalent to "$1c$2c..."
  • $@ is equivalent to "$1" "$2" ...

So A B becoming "A B" is expected.

Regardless, I think git touch should follow the functionality you expect (A B becomes A and B) to match the functionality of touch, so I would vouch if you sent in a PR. 👍

@hemanth?

@al-the-x
Copy link
Contributor Author

Happy to submit a PR... It's an easy fix.

@al-the-x
Copy link
Contributor Author

Do you mind leaving this issue open until I have a PR to replace it (and link it appropriately)? I don't want to lose track of this issue...

al-the-x added a commit to al-the-x/git-extras that referenced this issue Oct 31, 2015
Blind first pass so that I have a PR to remind me...
@qw3rtman qw3rtman reopened this Dec 28, 2015
@qw3rtman
Copy link
Collaborator

No problem, reopened.

al-the-x added a commit to al-the-x/git-extras that referenced this issue Dec 28, 2015
Blind first pass so that I have a PR to remind me...
@al-the-x
Copy link
Contributor Author

al-the-x commented Jan 4, 2016

Closed by #481

@al-the-x al-the-x closed this as completed Jan 4, 2016
tardypad pushed a commit to tardypad/git-extras that referenced this issue Jul 13, 2016
Blind first pass so that I have a PR to remind me...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@al-the-x @qw3rtman and others