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

Leave repository in clean state after commit #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Leave repository in clean state after commit #3

wants to merge 2 commits into from

Conversation

hauleth
Copy link

@hauleth hauleth commented Jan 16, 2016

This will clean repository state after commit removing all @commit from diff.

This will clean repository state after commit removing all `@commit` from diff.
@jryio
Copy link
Owner

jryio commented Jan 16, 2016

Oh this is great! Let run some tests quickly.

Thank you so much for this! Leaving the repository littered with changes to stage was not the best.

@jryio
Copy link
Owner

jryio commented Jan 16, 2016

@hauleth One issue I am having is that once a commit is complete, the git commit command hangs for 100+ seconds.

That is, once you write your commit and close the editor, the process does not quit immediately after completing the post-commit hook with the added changes from this PR.

Here is the output I got after letting git commit run for about 2 minutes.
Side note: I titled my commit Another test, do not add

.git/hooks/prepare-commit-msg: fork: Resource temporarily unavailable
.git/hooks/prepare-commit-msg: fork: Resource temporarily unavailable
.git/hooks/prepare-commit-msg: fork: Resource temporarily unavailable
.git/hooks/prepare-commit-msg: fork: Resource temporarily unavailable
.git/hooks/prepare-commit-msg: fork: Resource temporarily unavailable
.git/hooks/prepare-commit-msg: fork: Resource temporarily unavailable
.git/hooks/prepare-commit-msg: fork: Resource temporarily unavailable
[hauleth-amend 53cf509] Another test, do not add
 Date: Fri Jan 15 20:56:46 2016 -0800
 4 files changed, 23 insertions(+), 21 deletions(-)
[hauleth-amend 53cf509] Another test, do not add
 Date: Fri Jan 15 20:56:46 2016 -0800
 4 files changed, 23 insertions(+), 21 deletions(-)
[hauleth-amend 00028c9] Another test, do not add
 Date: Fri Jan 15 20:56:46 2016 -0800
 4 files changed, 23 insertions(+), 21 deletions(-)
[hauleth-amend 00028c9] Another test, do not add
 Date: Fri Jan 15 20:56:46 2016 -0800

# I cut out about 1,000 repetitions

 4 files changed, 23 insertions(+), 21 deletions(-)
[hauleth-amend 94da598] Another test, do not add
 Date: Fri Jan 15 20:56:46 2016 -0800
 4 files changed, 23 insertions(+), 21 deletions(-)
[hauleth-amend 03f8d6b] Another test, do not add
 Date: Fri Jan 15 20:56:46 2016 -0800
 4 files changed, 23 insertions(+), 21 deletions(-)
[hauleth-amend 4c8dd4b] Another test, do not add
 1 file changed, 2 insertions(+)

This might be caused by how Bash implements the @ operator for lists when using "${ADDED_FILES[@]}" - I will look into this.

For reference I am running a zsh terminal session, using Git version 2.6.3 and using Vim as my commit editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants