Comments (8)
Another approach for __shortlog would be to stick with "git log" and simply pass it the range of commit IDs. This approach also addresses the diffstat issue:
def __diffstat(stack, patches, diff_opts):
rev1 = stack.patches.get(patches[0])
rev2 = stack.patches.get(patches[-1])
return stack.repository.diff_tree(
rev1.commit.data.tree,
rev2.commit.data.tree,
diff_opts,
stat=True,
)
from stgit.
My Python is immensely rusty, but here's a patch that addresses the issues.
https://github.com/chucklever/stgit/commit/d120b78ab791d467a1c14ae894142de5c6971c70
from stgit.
My approach works fine for ranges, but providing "stg mail" with a list of individual patches will require __shortlog to continue to use a loop that processes each patch in the list. I will update my patch to address this.
Unfortunately, a list-based approach does not work for the diffstat: There's no way to make that output meaningful for a sparse list of patches. For the moment, I'm sticking with a range-based approach, which was what was in place before 5b99acc .
from stgit.
I forgot to update here last week. The fix has been split into two commits:
shortlog:
https://github.com/chucklever/stgit/commit/5ad3d67035132122986c9b5ae3ce0284c6f5f120
diffstat:
https://github.com/chucklever/stgit/commit/aad399762a4dc359d7e4846180dfd3e84de5b48e
from stgit.
Thanks @chucklever for this issue report and for these patches. I have not yet had time to dig into the details, but I appreciate this help and I will look into this deeper in my next StGit cycles.
I will admit that stg mail
is a bit of a blind spot for me. The test suite does not cover stg mail
particularly well and my personal workflows have not needed stg mail
. A longer-term goal I have in mind for stg mail
is to see if we can replace its guts with git send-email
. My general belief is that stg mail
could shed a lot of code and become more correct by leveraging git send-email
.
So it's nice to know that there is at least one stg mail
user out there!
from stgit.
The one open issue for me here is I would like to know how to generate a proper diffstat for a sparse list of patches! Perhaps git send-email would help with that.
from stgit.
Fwiw, the diffstat situation has not gone unnoticed within git itself:
https://lwn.net/Articles/802797/
from stgit.
I have pushed the two repairs you made, @chucklever. Thank you!
I updated a unit test to check for the shortlog problem.
And I made one change to not pass the user-provided diff options (from --diff-opt
) to the diff stat in the shortlog. I think those options should only be applied to the diffs in the patch messages themselves. Instead, we now pass --stat-width=72
to for the shortlog's diffstat. This is similar to what git format-patch
does.
Anyway, I think this issue can be put to rest. Thank you again for finding and fixing this problem!
from stgit.
Related Issues (20)
- Auto-`pop` a chain of patches to avoid merge conflicts HOT 1
- Non-stacky `pop`/`push` HOT 2
- "stg email" is very different than "stg mail" HOT 1
- stgit not finding user information HOT 3
- stg status: error: while expanding shell alias (program not found) HOT 1
- error: running editor: vi: The system cannot find the file specified. (os error 2)
- "stg pop --spill" leaves patch modifications staged HOT 1
- "new, pop, edit, refresh, push" results in empty top patch? HOT 5
- "stg branch some_other_branch --delete" deletes _current_ branch HOT 1
- Argv ordering requirements unnecessarily strict HOT 5
- FR: `swap` command for reordering patches - keeping tree contents the same at each HOT 3
- Question about stg edit
- stg mail --compose is not setting In-Reply-To or Reference from the cover letter.
- stg mail send with multiple --cc options only honors the first HOT 2
- feature request: stg whatchanged HOT 2
- feature request: stg move HOT 1
- Refresh installation documentation on https://stacked-git.github.io/ HOT 2
- [feature request]: run command on each (applied) patch HOT 3
- Renaming a commit as part of `stg refresh -e` ignores changes to the body HOT 1
- "stg import --reject" is broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stgit.