|
| 1 | +From: =?utf-8?b?T3R0byBLZWvDpGzDpGluZW4=?= <otto@debian.org> |
| 2 | +Date: Thu, 21 Nov 2024 00:23:12 -0800 |
| 3 | +Subject: Stop modifying upstream .gitignore file |
| 4 | + |
| 5 | +The fact that Debian builds produce extra files in the build directory |
| 6 | +is a separate concern and should not be managed by .gitignores in upstream |
| 7 | +directory. Anyways, the list is not going to be complete on most packages, |
| 8 | +and instead of extending the list, a better practice is to have proper |
| 9 | +`make clean` rules in the `debian/rules`, or to simply run `git clean -fdx` |
| 10 | +between builds. Additionally, everyone should be using `gbp pq` to update |
| 11 | +patches instead of legacy Quilt, so no more `.pc` directories should be |
| 12 | +generated. |
| 13 | +--- |
| 14 | + make.go | 23 ----------------------- |
| 15 | + 1 file changed, 23 deletions(-) |
| 16 | + |
| 17 | +diff --git a/make.go b/make.go |
| 18 | +index c7e7505..14f267f 100644 |
| 19 | +--- a/make.go |
| 20 | ++++ b/make.go |
| 21 | +@@ -510,29 +510,6 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream, |
| 22 | + return dir, fmt.Errorf("import-orig: %w", err) |
| 23 | + } |
| 24 | + |
| 25 | +- { |
| 26 | +- f, err := os.OpenFile(filepath.Join(dir, ".gitignore"), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) |
| 27 | +- if err != nil { |
| 28 | +- return dir, fmt.Errorf("open .gitignore: %w", err) |
| 29 | +- } |
| 30 | +- // Beginning newline in case the file already exists and lacks a newline |
| 31 | +- // (not all editors enforce a newline at the end of the file): |
| 32 | +- if _, err := f.Write([]byte("\n/.pc/\n/_build/\n")); err != nil { |
| 33 | +- return dir, fmt.Errorf("write to .gitignore: %w", err) |
| 34 | +- } |
| 35 | +- if err := f.Close(); err != nil { |
| 36 | +- return dir, fmt.Errorf("close .gitignore: %w", err) |
| 37 | +- } |
| 38 | +- } |
| 39 | +- |
| 40 | +- if err := runGitCommandIn(dir, "add", ".gitignore"); err != nil { |
| 41 | +- return dir, fmt.Errorf("git add .gitignore: %w", err) |
| 42 | +- } |
| 43 | +- |
| 44 | +- if err := runGitCommandIn(dir, "commit", "-m", "Ignore _build and quilt .pc dirs via .gitignore"); err != nil { |
| 45 | +- return dir, fmt.Errorf("git commit (.gitignore): %w", err) |
| 46 | +- } |
| 47 | +- |
| 48 | + return dir, nil |
| 49 | + } |
| 50 | + |
0 commit comments