Issue #64 resolved

Push confirmation

Robert Mandelson
created an issue

It would be nice to have some confirmation after successfully pushing, such as "Pushed x changesets".

Comments (5)

  1. David Carr

    I hadn't previously done work in this specific direction, but now I've looked at it a bit, and it looks doable.

    For a regular-Hg push, output looks something like this:

    pushing to $TESTTMP/remoterepo
    searching for changes
    adding changesets
    adding manifests
    adding file changes
    added 2 changesets with 2 changes to 2 files
    updating bookmark master
    

    For an Hg-Git push, I think I've found ways to get access to the information needed to generate messages like this:

    pushing to $TESTTMP/remoterepo
    searching for changes
    creating and sending data
    added 2 commits with 2 blobs to 2 trees
    modified 1 remote references (updated 1, added 0, removed 0)
    

    Dulwich doesn't provide separate hooks for distinguishing between adding/sending commits/trees/blobs, so a single progress message along the lines of "creating and sending data" is about all we can do before everything is done. We can, of course, change the wording.

    I believe I have access to the number of commits, blobs, trees, and tags pushed. My git-fu isn't strong enough to know if there are other types of Git objects that I should be aware of that might be pushable. I can either expose the counts directly as shown above, which seems roughly comparable to what regular Hg does, or I can give a higher-level summary (maybe "added N objects"?).

    I also have access to the remote references both before and after the push, and can check if any were added/removed, and if any changed their hash. I'm not sure what information is best to show for this. Or maybe I should hold off on that until the Hg-Git new bookmark support is further along. I think the normal hg output would be something like "updating bookmark master".... which might be what should be used here.

    UPDATE: added in the last two lines of the example hg output

  2. Log in to comment