Age | Commit message (Collapse) | Author |
|
Git mailinfo output is going to be in the same character set as
specified in the message headers, so we should not assume that we can
read it back in unicode.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Since we're piping out to stdout, there's obviously no reason to show
what the "git am" command should be -- especially if we delete the
temporary mbox file after the command completes.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
By request, provide a way to output the results of b4 am to stdout. This
way it can be piped straight to "git am".
E.g.:
b4 diff 20200526205322.23465-1-mic@digikod.net -o - | git am
Requested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Let's keep our code sources in plain old ascii.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
I think it's time to have more people poking at the diff functionality.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Make sure we a) attempt to backfill the series if they are incomplete,
b) error out if the series is incomplete anyway
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The original code used for b4 diff was to prepare for a 3-way merge by
making sure that all blob indexes exist in the local repo. Add this
functionality to "b4 am" and document all the features added in the
0.5.0 branch.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
When we can't auto-find the previous version (usually because the cover
letter subject changes), suggest what to do: run b4 am -T and b4 diff on
both mboxes.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Sometimes we are unable to properly look up previous series -- usually
because the cover letter title changes. For those cases, it is now
possible to diff two arbitrary mbox files prepared with "b4 am -T".
There's also a smattering of other fixes in there because I'm too
lazy to properly stage my patches.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Also, make sure we display which versions we are diffing.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't make developers do copy-pasting unnecessarily. Switch to
outputting the diff by default, with flag options to save to file or
just show what needs to be done.
Additionally, adds caching to lookups and remember previously generated
fake-am ranges so we don't continuously generate loose objects on repeat
runs.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Need to figure this out earlier, but at least don't try to compare two
versions to itself.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Based on feedback from Jason Gunthorpe, implement diffing of series by
creating fake git-am commit ranges. Here's an easy example:
b4 diff 20200511192156.1618284-1-mic@digikod.net
Suggested-by: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Git has a lot of internal logic matching free-form branch names to
actual branches, so don't try to second-guess what it finds acceptable.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Add changes to -P,--cherry-pick to the man page.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
In addition to numerical ranges, -P is now also able to do:
- "-P _" to grab just the msgid used with "b4 am"
- "-P *glob*" to filter by commit message subject
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Found via auto-testing in:
https://lore.kernel.org/linux-sgx/20200421215316.56503-13-jarkko.sakkinen@linux.intel.com/raw
This is wrong on many levels:
Content-Type: text/plain; charset=a
Assume utf-8 when something like this happens and don't fail.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't crash if the message in the References: is not available in the
thread.
Reported-by: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Git will try to helpfully disambiguate, but we just need consistency, so
always ask for a full refname.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Not all local branches are going to have matching [branch] entries --
sometimes there is only a [remote]. Deal with both cases.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
While trying to be more permissive with messages selected manually with
-s, we broke auto-thankanator by making it match everything.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
- we are now using ranges for ty -s/-d
- add am -P documentation for cherry-picking subsets of patches
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
This lets someone select a subset of patches in a series, e.g.:
b4 am -P 1-3,5,7- [msgid]
Suggested-by: Heiko Stübner <heiko@sntech.de>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Track message-id for each patch and try to apply to the Link: or
Message-Id: trailers, if we find them.
Suggested-by: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Our mapping of local to remote branches was very naive and failed when
remote names didn't exactly match heads. Improve it using suggestions
from Will Deacon.
Link: https://linux.kernel.org/g/tools/message/140
Reported-by: Will Deacon <will@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Instead of insisting that people put in specific numbers, allow them to
specify ranges, such as:
b4 ty -s 1-3,5,7-
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Do not try to calculate indexes on a missing patch in an incomplete
thread.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Make sure we get the clean header value when we store fromname.
Link: https://linux.kernel.org/g/tools/message/142
Reported-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Check if all patches in the mbox would apply cleanly to the current
tree:
- find index hash..hash information in each patch
- check if git-hash-object shows exact same hashes for the current tree
- if not, try the last 10 tags to see if any of them would be a good
base-commit for the patch/series
Not sure how useful the latter part it, but it hopefully shouldn't slow
down regular operations, so I'm going to leave it in for now.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Do a better job parsing a patch message into usual body parts:
- git headers (From:, Subject:, Date:)
- commit message
- trailers
- basement (under the ---\n)
- signature (under the --\s\n)
This allows us to create better reply quotes.
Reported-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We want to make those available to pip installs.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
It's time to graduate to 0.4.0 with these features.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
This is our fail-through treename, so if we weren't able to figure out
anything about it, then call it a "local tree" instead of "undefined".
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
When running rev-list, be mindful of which branch we need to operate on,
otherwise it always runs on the current branch.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
When we have a cover letter, use that for backfill purposes, instead of
finding the first non-None patch.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Git's file delete patches don't contain hunks, so we weren't properly
processing them for attestation (and for b4 am). While fixing that, I
also added attestation support for binary patches.
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
You can use ${branch} and ${treename} (if you set b4.thanks-treename).
See .example files on some hints on how to use them.
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
- Properly expand ~ and env vars like $HOME in template paths
- Allow partial matching of series (with a warning)
- Allow using remote branches with -b
- Always fall back to subject matching for patches
- Tweak to the summary output
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We weren't properly handling special diffs that deleted entire file
contents (e.g. by deleting a file).
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
When a commit is a new file with only one line, the diff output is
different, so handle it without breaking.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't tell us to run git send-email when there's nothing to send.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Git gets user.name from gecos if it's not specified in user.name, so
let's do the same thing.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Instead of bailing out when we can't find a match for a series, skip it
and move to the next one in the queue.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Using strict attestation hashes for auto-thankinator is problematic,
because "git am" uses a certain degree of fuzzing, so when we try to
find applied patches by running "git diff" on actual commits, line
counts may not be bit-for-bit identical.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Still a bit slim on documentation, but this is better than nothing. I
need to write a better README file that will introduce maintainers to
most useful functionality aspects of b4.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
If we find a ~/.signature, then use it for making a default ${signature}
value, otherwise make a "Name <email>" boring one.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
They are much more useful if b4.thanks-commit-url-mask is set, but even
without them this will list all subjects and corresponding commit IDs.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Looks like some of the patches sent from quilt (at least from Andrew
Morton) are not properly parsed by git patch-id, so use our own patch
hashing routines, even if this means we're likely going to miss some of
the patches that were edited by maintainers.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|