Skip to content

Commit b3e5c64

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 7abe1e9 commit b3e5c64

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

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

0 commit comments

Comments
 (0)