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

catch new untracked and unignored files #3875

Merged
merged 1 commit into from
Nov 20, 2022

Conversation

deitch
Copy link
Collaborator

@deitch deitch commented Nov 15, 2022

Signed-off-by: Avi Deitcher avi@deitcher.net

- What I did

pkg show-tag reports if a directory tree is dirty, but it misses new untracked files. If a file is in the directory, and is not tracked and also is not in .gitignore, we should treat that is dirty.

- How I did it

Added ls-files with appropriate options.

- How to verify it

I tested it on various scenarios:

  • new file in dir - catches it
  • new file not in dir - ignores it
  • new file in dir but also in gitignore - ignores it

- Description for the changelog

show-tag treats untracked and unignored files as a dirty package.

@giggsoff
Copy link
Contributor

giggsoff commented Nov 16, 2022

Can we also adjust contentHash function to handle untracked files? Now they are not covered by hash calculation:

$ ./bin/linuxkit pkg show-tag ../../../pkg/acpid/
linuxkit/acpid:c05a368754f6436b326945dc16135ba547568d8d
$ touch ../../../pkg/acpid/file
$ ./bin/linuxkit pkg show-tag ../../../pkg/acpid/
linuxkit/acpid:c05a368754f6436b326945dc16135ba547568d8d-dirty-e785871
$ echo "test">../../../pkg/acpid/file
$ ./bin/linuxkit pkg show-tag ../../../pkg/acpid/
linuxkit/acpid:c05a368754f6436b326945dc16135ba547568d8d-dirty-e785871

Signed-off-by: Avi Deitcher <avi@deitcher.net>
@deitch
Copy link
Collaborator Author

deitch commented Nov 16, 2022

Good idea. Done.

Copy link
Contributor

@giggsoff giggsoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
With such changes we will be able to completely get rid of force flag during local development, since now linuxkit (and user) will see that there are changes in source tree regardless of git add command which may come later.

@deitch deitch merged commit 7c5b1f1 into linuxkit:master Nov 20, 2022
@deitch deitch deleted the show-tag-new-files branch November 20, 2022 15:29
giggsoff added a commit to itmo-eve/eve that referenced this pull request Nov 22, 2022
Let's make FORCE_BUILD flag optional and rely on hash provided by
linuxkit on changes (linuxkit/linuxkit#3875).
With no flag provided linuxkit will check that
image published, if not, will build it.
This way we can avoid building of dependencies as well.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
giggsoff added a commit to itmo-eve/eve that referenced this pull request Nov 22, 2022
With enforced checking from linuxkit
(linuxkit/linuxkit#3875) we must be more
accurate with generated files and add them to gitignore

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
dautovri pushed a commit to lf-edge/eve that referenced this pull request Nov 25, 2022
With enforced checking from linuxkit
(linuxkit/linuxkit#3875) we must be more
accurate with generated files and add them to gitignore

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
giggsoff added a commit to itmo-eve/eve that referenced this pull request Nov 26, 2022
Let's make FORCE_BUILD flag optional and rely on hash provided by
linuxkit on changes (linuxkit/linuxkit#3875).
With no flag provided linuxkit will check that
image published, if not, will build it.
This way we can avoid building of dependencies as well.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
dautovri pushed a commit to dautovri/eve that referenced this pull request Nov 28, 2022
With enforced checking from linuxkit
(linuxkit/linuxkit#3875) we must be more
accurate with generated files and add them to gitignore

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
(cherry picked from commit bcbbfaa)
eriknordmark pushed a commit to lf-edge/eve that referenced this pull request Nov 29, 2022
Let's make FORCE_BUILD flag optional and rely on hash provided by
linuxkit on changes (linuxkit/linuxkit#3875).
With no flag provided linuxkit will check that
image published, if not, will build it.
This way we can avoid building of dependencies as well.

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
eriknordmark pushed a commit to lf-edge/eve that referenced this pull request Nov 30, 2022
With enforced checking from linuxkit
(linuxkit/linuxkit#3875) we must be more
accurate with generated files and add them to gitignore

Signed-off-by: Petr Fedchenkov <giggsoff@gmail.com>
(cherry picked from commit bcbbfaa)
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

Successfully merging this pull request may close these issues.

None yet

2 participants