Skip to content

Commit 049cf81

Browse files
committed
Stop modifying upstream .gitignore file
The fact that Debian builds produce extra files in the build directory is a separate concern and should not be managed by .gitignores in upstream directory. Anyways, the list is not going to be complete on most packages, and instead of extending the list, a better practice is to have proper `make clean` rules in the `debian/rules`, or to simply run `git clean -fdx` between builds. Additionally, everyone should be using `gbp pq` to update patches instead of legacy Quilt, so no more `.pc` directories should be generated.
1 parent acfef1a commit 049cf81

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

make.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -521,29 +521,6 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
521521
return dir, fmt.Errorf("import-orig: %w", err)
522522
}
523523

524-
{
525-
f, err := os.OpenFile(filepath.Join(dir, ".gitignore"), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
526-
if err != nil {
527-
return dir, fmt.Errorf("open .gitignore: %w", err)
528-
}
529-
// Beginning newline in case the file already exists and lacks a newline
530-
// (not all editors enforce a newline at the end of the file):
531-
if _, err := f.Write([]byte("\n/.pc/\n/_build/\n")); err != nil {
532-
return dir, fmt.Errorf("write to .gitignore: %w", err)
533-
}
534-
if err := f.Close(); err != nil {
535-
return dir, fmt.Errorf("close .gitignore: %w", err)
536-
}
537-
}
538-
539-
if err := runGitCommandIn(dir, "add", ".gitignore"); err != nil {
540-
return dir, fmt.Errorf("git add .gitignore: %w", err)
541-
}
542-
543-
if err := runGitCommandIn(dir, "commit", "-m", "Ignore _build and quilt .pc dirs via .gitignore"); err != nil {
544-
return dir, fmt.Errorf("git commit (.gitignore): %w", err)
545-
}
546-
547524
return dir, nil
548525
}
549526

0 commit comments

Comments
 (0)