Code Monkey home page Code Monkey logo

Comments (8)

chucklever avatar chucklever commented on September 1, 2024

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.

chucklever avatar chucklever commented on September 1, 2024

My Python is immensely rusty, but here's a patch that addresses the issues.

https://github.com/chucklever/stgit/commit/d120b78ab791d467a1c14ae894142de5c6971c70

from stgit.

chucklever avatar chucklever commented on September 1, 2024

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.

chucklever avatar chucklever commented on September 1, 2024

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.

jpgrayson avatar jpgrayson commented on September 1, 2024

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.

chucklever avatar chucklever commented on September 1, 2024

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.

chucklever avatar chucklever commented on September 1, 2024

Fwiw, the diffstat situation has not gone unnoticed within git itself:

https://lwn.net/Articles/802797/

from stgit.

jpgrayson avatar jpgrayson commented on September 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.