-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Update gitignore when switching subdirectories between normal and generated #492
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#! /bin/sh -e | ||
# tup - A file-based build system | ||
# | ||
# Copyright (C) 2024 Bojidar Marinov <bojidar.marinov.bg@gmail.com> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 2 as | ||
# published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, write to the Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
|
||
# Make sure importing with a default value works when the environment variable | ||
# is set the first time tup is called. | ||
|
||
. ./tup.sh | ||
|
||
cat > Tupfile <<HERE | ||
.gitignore | ||
: |> touch %o |> out/generated.txt | ||
HERE | ||
cat > Tupdefault <<HERE | ||
.gitignore | ||
HERE | ||
|
||
update | ||
gitignore_good out .gitignore | ||
|
||
touch out/non-generated.txt | ||
|
||
update | ||
gitignore_bad out .gitignore | ||
gitignore_good generated.txt out/.gitignore | ||
|
||
eotup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#! /bin/sh -e | ||
# tup - A file-based build system | ||
# | ||
# Copyright (C) 2024 Bojidar Marinov <bojidar.marinov.bg@gmail.com> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 2 as | ||
# published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, write to the Free Software Foundation, Inc., | ||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
|
||
# Make sure importing with a default value works when the environment variable | ||
# is set the first time tup is called. | ||
|
||
. ./tup.sh | ||
|
||
cat > Tupfile <<HERE | ||
.gitignore | ||
: |> touch %o |> out/generated.txt | ||
HERE | ||
cat > Tupdefault <<HERE | ||
.gitignore | ||
HERE | ||
mkdir out | ||
touch out/non-generated.txt | ||
|
||
update | ||
gitignore_bad out .gitignore | ||
gitignore_good generated.txt out/.gitignore | ||
|
||
rm out/non-generated.txt | ||
|
||
update | ||
gitignore_good out .gitignore | ||
check_not_exist out/.gitignore | ||
|
||
eotup |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This should probably still take a struct tupfile, since this function should be printing errors to
tf->f
instead ofstderr
. The former will print the error messages under the banner of the directory being parsed, rather than immediately, so it is more obvious which directory actually failed. I can fix this in a separate commit if you like.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.
Err in retrospect, keeping the struct tupfile would make moving it into updater.c more difficult. I am making a change now to make this a FILE *err input instead, so the updater.c usage of it can pass in stderr and the parser.c usage can pass in tf->f.
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.
Ah, yeah, I was wondering if we still had a valid tupfile in updater.c for that 😅
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.
Alright, I left this one for you, since you said you already had a patch waiting; but I fixed the other issues. I think it might be good to go, but you'll be the judge of that XD