Skip to content

Commit 3473a2a

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 7710a55 commit 3473a2a

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
@@ -510,29 +510,6 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
510510
return dir, fmt.Errorf("import-orig: %w", err)
511511
}
512512

513-
{
514-
f, err := os.OpenFile(filepath.Join(dir, ".gitignore"), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
515-
if err != nil {
516-
return dir, fmt.Errorf("open .gitignore: %w", err)
517-
}
518-
// Beginning newline in case the file already exists and lacks a newline
519-
// (not all editors enforce a newline at the end of the file):
520-
if _, err := f.Write([]byte("\n/.pc/\n/_build/\n")); err != nil {
521-
return dir, fmt.Errorf("write to .gitignore: %w", err)
522-
}
523-
if err := f.Close(); err != nil {
524-
return dir, fmt.Errorf("close .gitignore: %w", err)
525-
}
526-
}
527-
528-
if err := runGitCommandIn(dir, "add", ".gitignore"); err != nil {
529-
return dir, fmt.Errorf("git add .gitignore: %w", err)
530-
}
531-
532-
if err := runGitCommandIn(dir, "commit", "-m", "Ignore _build and quilt .pc dirs via .gitignore"); err != nil {
533-
return dir, fmt.Errorf("git commit (.gitignore): %w", err)
534-
}
535-
536513
return dir, nil
537514
}
538515

0 commit comments

Comments
 (0)