MCPcopy Create free account
hub / github.com/apache/solr / ensure_unreleased_gitkeep

Function ensure_unreleased_gitkeep

dev-tools/scripts/logchange.py:159–170  ·  view source on GitHub ↗

Ensure changelog/unreleased/.gitkeep exists and is staged. After a release the unreleased/ folder may be absent or untracked. Committing a .gitkeep guarantees contributors always find the folder.

(git_root, dry_run=False)

Source from the content-addressed store, hash-verified

157
158
159def ensure_unreleased_gitkeep(git_root, dry_run=False):
160 """Ensure changelog/unreleased/.gitkeep exists and is staged.
161
162 After a release the unreleased/ folder may be absent or untracked.
163 Committing a .gitkeep guarantees contributors always find the folder.
164 """
165 gitkeep = git_root / "changelog" / "unreleased" / ".gitkeep"
166 if not gitkeep.exists():
167 print(f" Creating {gitkeep.relative_to(git_root)}")
168 if not dry_run:
169 gitkeep.parent.mkdir(parents=True, exist_ok=True)
170 gitkeep.touch()
171
172
173def run_logchange_generate(gradle_cmd, git_root, dry_run=False):

Callers 2

cmd_prepareFunction · 0.85
cmd_forward_portFunction · 0.85

Calls 2

touchMethod · 0.80
existsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…