-
Notifications
You must be signed in to change notification settings - Fork 9
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
Files that aren't in the commit are searched for commit comments #1
Comments
I tried to look into it. Quickfix: https://stackoverflow.com/questions/11206233/what-does-the-operator-do-in-shell-scripts but .gitignore format is different from regex, and maybe it's better to use that? https://stackoverflow.com/questions/2412450/git-pre-commit-hook-changed-added-files but LarryH there points out that you'll pick up comments that are not up for being committed. That's bad because I love In the meantime, I'll have to uninstall this :-( |
Sorry this isn't working and I appreciate the research into the issue! I've looked into the compatibility of the Regular Expression operator for Bash version 3.1 - Documentation. It explains that the Regular Expression operator is indeed present for Bash (so you're not missing the operator). However one change which was made after Bash version 3.2 is that the right hand side of the operator should not be quoted Ex. Can you test the following commands (just enter them directly into Bash terminal session) and reply with the output? if [[ "hello world" =~ ".*" ]]; then echo "it worked"; else echo "it failed"; fi if [[ "hello world" =~ .* ]]; then echo "it worked"; else echo "it failed"; fi That would help determine if that is your issue I am unable to reproduce this bug using Bash version 3.1. Here are some of the tests I've done to replicate this.
root@test-server:~# bash --version
GNU bash, version 3.1.0(1)-release (x86_64-unknown-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
root@test-server:~#
cd commit-comments
root@hi-predictor-api:~/commit-comments# ./test.sh
- Added new link parsing function
- Stored Hello World in string
- Inline commit comment
- Another inline commit comment
- final inline commit comment
- Added a new function to basic.cpp
- Added forEach function for NodeList elements Also, I made another script with your modified contents and executed it: root@test-server:~/commit-comments# ./son-of-lilit.sh
.ccignore
************
.ccignore
.ccignore
ccignore
LICENSE
LICENSE
LICENSE
README.md
README.md
md
post-commit
post-commit
post-commit
prepare-commit-msg
prepare-commit-msg
prepare-commit-msg
test-files/basic.cpp
basic.cpp
cpp
test-files/thing.js
thing.js
js
test.sh
test.sh
sh Could you please add your Operating System & version & any other shells you have running? Thank you! |
also:
I'm running Git Windows' bash on Windows 7. It has never shown deviance from standard before, but who knows.
I'll install 2.x and see if it helps. However, I feel that the real issue I reported was this:
and it's far worse than some syntax error I have a slow workaround for, and even from |
Ah sorry for glossing over the second issue. Let me tackle those in order:
Edit: For portability I will no longer use the |
First the small things:
An extension is ignored in .gitignore syntax by You were looking at araqnid's response to that SO question. That's the less interesting one (it gives a better way to do more or less the same thing, but that's the wrong thing to do.) Read LarryH's response. If you want to adopt his method, I will consider trying my hands at it, but it's not that simple (especially removing the comments that were staged but not others... I think we'll need to do it in the temporary copy, then generate a patch, then apply it to the working dir... but this smells like "there will be horrible complications".) |
This commit resolves an issue with a GNU grep command using the -P flag. As a result, users without GNU Grep could not use the Perl Regular Expressions flag. This command has been removed and replaced with pcregrep which yields the same results and also allows forward look-aheads. Additionally, the test-files have been added to the .ccignore file so cloning the repository does not cause users to have the test-files in their first commit message. Closes Issue #1
Pardon the reference, wrong issue number.
I did read LarryH's response, and saw his solution for creating a temp directory, but I think a simpler approach exists. If we're solving the issue of only reading & removing comments from staged files (either Added, Modified, or Copied) then storing the result of Additionally, @hauleth just submitted Pull Request #3 which attempts to leave a clean repository after removing comments (no longer requiring a second commit once files are removed). Would you say that tying your suggestion with @hauleth's addition would fully cover the issues? |
The problem is that I can (and often do) "add" only part of a file. On Sat, Jan 16, 2016 at 8:35 AM Jacob Young notifications@github.com
|
Okay I clearly understand now. Personally I do not use interactive Git adding using I'll try to incorporate this solution, however as you said, it might be a large architectural - but I will certainly attempt it |
Woops, I meant Basically, with git you can commit an index that's completely unrelated to On Sat, Jan 16, 2016 at 9:20 PM Jacob Young notifications@github.com
|
Running
gives
The text was updated successfully, but these errors were encountered: