Git-pile

Latest version: v1.1

Safety actively analyzes 623626 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.1

Release notes

Compared to 1.0 this is mostly a bug fix release, raising the compatibility with more git versions, although
dropping the support for python 3.6 since its EOL already. Summary of the changes:

- Bump minimum required python version to 3.7
- Fix calls to `git-worktree add` with git 2.25 and older
- ci: use container for testing different git versions and start testing with several git versions commonly used in distros
- `genbranch` learned a --external-pile to be able to use a directory with patches. Besides being sometimes useful to import from quilt, it also helps with internal tests
- Fix calls to git-pile when using the pile checkout as the CWD. In git-pile 1.0 the ability to call the subcommands from the pile checkout got disabled due to the added support for multiple pile checkouts using git-worktree. However in some scenarios git-pile was exploding with backtraces. Fix the backtraces and allow again the subcommands to be called from any directory
- Increase coverage tests for `genbranch`
- Add compatibility with different git versions returning absolute or relative paths in git-worktree
- Fix `genbranch` storing an invalid cache file when called without the `-i` option and failing. When updating to git-pile 1.1, previously saved caches will be invalidated to make sure a wrong cache is not used.

**Full Changelog**: https://github.com/git-pile/git-pile/compare/v1.0...v1.1

1.0

Release Notes

- `genbranch` learned a `--baseline` option to override the baseline to be used. It's useful when migrating
the entire pile on top of a different commit, without having to manually edit the config file.
- `genbranch` learned a `--no-fuzzy` option to allow the user to manually disable the fuzzy genbranch. That
was not previously possible if stdin is a tty.
- `genbranch` now caches the operations done so it re-uses the partial state of the result-branch it generated
before. This allows genbranch to be very fast if the changes to the pile are mostly happening at the top rather
than near the baseline. For big pile branches with a few thousand patches, a speedup of ~10x is achieved
if all the changes are on the top 10% of the pile. The cache can be disabled with `--no-cache` or with the
equivalent option in the git config.
- `format-patch` has improved the --signoff behavior:
* It now understands a `-s` option as an alias
* `pile.format-signoff` option from the git config is also parsed, allowing the setting to be permanent
per repository
* Do not signoff a commit if it's already signed
- Fix `format-patch` when the old or new ranges of commits is empty
- `am` now does no print a backtrace if the file doesn't exist
- `genlinear-branch` now properly prioritize `--branch` in the command line vs configuration
- `genlinear-branch` learned two new options: --pre-genbranch-exec and --post-genbranch-exec. This allows
to pass a script/command to be executed before/after genlinear-branch calls genbranch on each commit
it is traversing. Main intention is to allow tweaking the pile or resetting the branch to a partial state.
- Support worktree-aware pile branches. Now git-pile works with extensions.worktreeConfig to allow setting
up multiple pairs of result-branch/pile-branch in a single repository.
- Modernize code base:
- Make heavy use of f-strings
- Auto-format the code
- Split git-pile file, that became way too big, in several smaller files implementing each subcommand
- Add better abstraction for commands and the pile handling
- Now bash completions can be installed to a different dir, allowing distros to package git-pile and install
the bashcompletions where they wish
- The help message for each command now also displays all the possible settings from the git config
that command understands
- Remove git-mbox-prepare: it was not being used and nowadays there is `b4` tool that does much more
- Test execution with python 3.6, 3.7, 3.9 and 3.10 in CI
- Add integration test framework based on `bats` and implement several tests to cover most of the user-facing
commands. Now there is also test coverage to show how much of the codebase is covered by tests.
- Add internal tool to measure and compare the execution time of multiple calls to genbranch

New Contributors
* DragoonAethis made their first contribution in https://github.com/git-pile/git-pile/pull/78
* guludo made their first contribution in https://github.com/git-pile/git-pile/pull/88

**Full Changelog**: https://github.com/git-pile/git-pile/compare/v0.99...v1.0

0.99

Release Notes
===========

- `reset` subcommand learned a --pile-only option. This will reset only the
pile branch and print the previous commit hash, making it easier to
generate another version

- Improve color handling when redirecting output

- Make git-pile operate per git worktree, removing the concept of "main"
worktree: besides allowing multiple pile checkouts (one per worktree),
it's also compatible with setups using a bare repo and checkouts on
the side, like:

~/playground.git
~/playground
~/playground/patches

- Fix `am` subcommand so it doesn't try to fix whitespace issues regardless
of user configuration: when handling diffs of patches, the
core.whitespace git configuration could lead to corrupted patches

- `format-patch` learned a --compose|--edit option so the editor is open
right after the command returns. This can be made the default behavior
by setting the configuration: ``git config pile.format-compose true`

- `genbranch` learned the --fuzzy option, just like `am` already had.
When generating the result branch, if git-am fails, it will try to
fallback to 2 other commands: `git-apply --reject --recount` and
`patch` (from patch-utils). This helps when there were conflicts
in `git pile am` that were lazily solved with the --fuzzy option.

- `format-patch` learned the --no-range-diff-filter. This allows to
generate a patch as if `genpatches` had been called without passing
through any filter to reduce the patch.

- Allow `am` subcommand to prompt the user for trying fuzzy resolution even
user piped the patch through it. This is done by consuming all the input
until it has the entire patch and then re-opening tty as the stdin. This
makes it compatible with workflows like i) piping the mbox directly from
the email client; ii) `curl ... | git pile am`.

- `baseline` subcommand now accepts an optional argument to operate in a
a different pile branch

0.98

Major improvements
=====
- genbranch is now ~6x faster by using git's split-index.

- format-patch is now ~6x faster by forking less

- format-patch now has a "fuzzy" mode. If running on a terminal, when
format-patch fails due to conflicts in the diff line numbers, it
will first prompt the user and if confirmed it will try to autosolve
those issues. There's also the --fuzzy|--no-fuzzy to be explicit on
the desired behavior. This helps when applying the patches and
avoiding manual work to bring it up to the current state of the pile
branch.

- REVIEW patch now has type text/x-patch to workaround patchwork waiting
indefinitely for patches when the overall diff is empty.

Other smaller changes
=====

- format-patch learned a -C|--reuse-message option like in git-commit
to reuse the commit message from another commit. This is useful when
applying a patch with am, changing it and submitting a v2: now you
can tell format-patch to reuse the previous cover letter from the
original v1 commit

- format-patch learned a -F|--file option like in git-commit to reuse
the commit message from a file or stdin. It's an alternative to the
-C above if you prefer to save the message on a separate text file.

- format-patch now uses the pile.format-output-directory from git
config. This is useful if you always output the patches to the same
temporary directory (as opposed to have them in CWD).

- format-patch learned a --signoff option to automatically add a
s-o-b in the cover letter. In normal git workflow people in general
don't add a s-o-b because the cover doesn't contain a patch, just
the overview. This is different with git-pile where the cover
becomes the pile commit. So this makes it easier for people who
is adding their s-o-b

- format-patch learned a -v|--reroll-count like in git-format-patch.
If you are sending a v2 of a patch series you can now use
`git pile format-patch -v2 ...` and the patches will have the
subject set to "PATCH v2", still honoring prefixes like we use in
i-g-t.

- genbranch now checks if --force is required before doing anything.
However it's advised that people switch to using -i, so issues can
still be fixed during genbranch

- genbranch learned a --fix-whitespace option to fixup whitespace
issues when generating the new branch. This is not the default
but may change before the release.

- init is now compatible with git > 2.28 when the default branch is
not "master".

- Add new "genlinear-branch" subcommand. It's not expected for
developers to run this locally, but this will soon be running on
automation so a linear branch is generated from the pile to make
it easier to see only the end diff from one pile commit to the
other. It also makes it easier to bisect as now the each commit
in this branch corresponds to calling genbranch on a particular
pile commit. Finally, it should help when sharing patches to

- git-pile now has 2 new repositories: git-pile/automation and
git-pile/playground - this has the necessary changes for integrating
Github PRs in our workflow (sending patches to the mailing list
for review, like GitGitGadget does for git development). This will
not be ready for prime time in this version, but if you'd like to
try it out when available, let me know and I will include you in.

0.97

- Allow files other than .patch, series and config in the pile branch: this helps to create CI integration in the pile branch

- Add sanity checks to `git pile destroy` and `git pile reset` to make sure we have a valid config before proceeding

- Add `--allow-local-pile-commits` to `git pile format-patch`. This allows to generate path even if you have local commits in the pile branch. Although sharing this is not useful since it can only be applied locally, it's useful when iterating new versions of a patch series, or just doing small changes before applying.

- Once upon a time Patchwork didn't add a link to the cover letter alone: it only provided the cover + patches. This made us use the `mailbox` module from python to help splitting the mbox. Unfortunately in some python versions `mailbox.mbox()` do not split it correctly when there is a line starting with "From" in the email body. Since now patchwork provides the coverletter alone, just stop splitting the mbox.

- Allow to override committer date and name/email in `git pile genbranch`: this allows the same result branch to be generated (with the same commit hashes) by different people and in multiple invocations of the same command. The setting `pile.genbranch_committer_date_is_author_date` defaults to True and will change the genbranch behavior to use the author's date as the committer date. There are 2 other settings: `pile.genbranch_user_name` and `pile.genbranch_user_email` that can be set to something unique across developers so they can re-use commits produced by a CI bot.

- Change the behavior of `git pile format-patch` to create separate patches only for the new commits instead of any changed commit. Reviewers usually look at the coverletter (for interdiff) or final "REVIEW" patch for overall diff to understand what changed. Only the new patches are actually useful to have as standalone patches to be reviewed. For big pile branches this allows to reduce the noise when submitting refactors in the entire pile. There is also a new option to tweak the percentage of change in a commit that triggers git to consider it as new commit instead of a modified one: `--creation-factor`. This is the same argument accepted by `git-range-diff` and uses git's default value as default (60% as per git 2.31).

- Change the diff order in the coverletter to help reviewers. Now the it is sorted to show the changes in the following file order: config, series, changed-patches, added-patches, removed-patches. Intention is that any change to the baseline is easily noticed, then changes to the series file for added/removed patches and where they are located, then the changes to individual patches. The added and removed patches are last as the interdiff is not very useful to review them

0.96

- First release on new repository, also available via pypi (https://pypi.org/project/git-pile/):
- `pip3 install [ --user | --upgrade ] git-pile`
- For installation via pip there is missing integration with man pages: they are not correctly installed. This will be fixed in a later version
- `git-pile format-patch` now checks if the commit used as baseline is available as a remote ref: it was a very common cause of invalid patch series when creating a v2 by applying the previous version to the tree and then reworking it
- `git-pile genbranch` learned a `--dirty` option that just applies the patches with `git apply` rather than re-creating the branch with `git am`. The speedup is in the order of 100x on a laptop and can be used for CI integration or as a quick check if the pile is in good shape.
- Check for minimum python version and alert user. We already depended on features from python 3.6, but we were not checking the version correctly
- PILE_RESULT_HEAD is not used anymore as depending on the git version accessing that file may only work on a single worktree checkout

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.