New merge request functionality!

Time for another Gitorious.org update! This time we’ve done some big improvements to the merge requests, resulting in a much better workflow if your project deals with a lot of merge reuqests.

But first up, some notes on the Markdown rendering in wiki pages, for far too long our markdown rendering have been less than optimal in some cases. But the causes was finally figured out in this thread on the mailing list.

Comments have also received some markup enhancements. We noticed that people aren’t that concerned with formatting according to the markdown rules in the comments, especially when it comes to new-lines (Markdown requires two newlines to render it as multiple paragraphs). As of today we do a bit of pre-processing of the comments so that a single newline becomes a <br /> tag. Wiki pages still work according to the stricter Markdown rules.

We’ve received some requests to be able to deny non-fast-forward pushes (eg `git push –force`), so under the repository settings there’s now a switch to deny non-fast-forwards. Turning it on will also deny deletion of refs (eg. `git push origin :branch-to-delete`).

But most of the recent work has been focused on the merge requests, for instance it’s now possible to supply a list of custom statuses for a merge request, if you find the default set doesn’t quite fit your needs, under the project settings.

Furthermore the set of commits in a merge request is now versioned, so if you get some feedback on your merge request and want to improve it, you no longer have to create a new merge request. In fact, all you have to do is push your changes to a special ref in the target repository!

So if I have merge request #892 in the diff-display project and I improved my patch, I can simply push my updates to a magic ref in the target repository:

$ git push git@gitorious.org:diff-display/mainline.git master:refs/merge-requests/892
Counting objects: 13, done.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 670 bytes, done.
Total 7 (delta 3), reused 0 (delta 0)
To git@gitorious.org:diff-display/mainline.git
   2a9b685..e30128e  master -> refs/merge-requests/892
=> Syncing Gitorious... [OK]

And my merge request suddenly has a new version number, I can even switch back and forth between the versions to see the changes.

Likewise as an integrator I can easily pull in the latest version of a merge request, since it’s stored in a special ref in the repository (which won’t be downloaded if you clone a repository, so you don’t end up with lots of refs you may not care about). So do integrate the merge request I could do the following:

$ git checkout -b integration
Switched to a new branch "integration"

$ git pull origin refs/merge-requests/892
From git@gitorious.org:diff-display/mainline
 * branch            refs/merge-requests/892 -> FETCH_HEAD
Already up-to-date.

$ git log --pretty=oneline --abbrev-commit master..integration
e30128e... Support the nonewline Line type in the renderers
2a9b685... Skip lines raising "invalid byte sequence" exceptions

Note that the above only applies to newly created merge-requests, for consistency reasons older merge requests haven’t been migrated (if you really need it, do contact support@gitorious.org and we’ll see what we can do). Another nice thing about the merge requests being versioned, is that I can still go back and see the commits after they have been merge.

We’ll be improving the merge requests even further over the next few weeks, but we think the above changes are pretty cool and useful.

5 Comments

  1. Anton
    Posted July 27, 2009 at 7:18 pm | Permalink

    Can’t update the merge request (am I doing something wrong? or should the repo maintainer enable something?):

    git push git@gitorious.org:f-spot/mainline.git disable_version_combo:refs/merge_requests/980

    Counting objects: 9, done.
    Compressing objects: 100% (5/5), done.
    Writing objects: 100% (5/5), 659 bytes, done.
    Total 5 (delta 4), reused 0 (delta 0)

    == Gitorious: ===========================================================
    You do not have write access to this repository
    ========================================================================

    error: hooks/pre-receive exited with error code 1
    To git@gitorious.org:f-spot/mainline.git
    ! [remote rejected] disable_version_combo -> refs/merge_requests/980 (pre-receive hook declined)
    error: failed to push some refs to ‘git@gitorious.org:f-spot/mainline.git’

  2. Christoph Bartoschek
    Posted August 15, 2009 at 4:06 pm | Permalink

    Would it be possible to get the required link one has to push the changes to on the request page? I tried to update my first request with:

    git push git@gitorious.org:qt/qt.git master:refs/merge-requests/1238

    but I only got:

    ! [rejected] master -> refs/merge-requests/1238 (non-fast forward)

    • zmalltalker
      Posted August 27, 2009 at 12:29 pm | Permalink

      Christoph,
      Since this is not a fast-forward, you will need to add -f/–force:

      git push --force git@gitorious.org:qt/qt.git master:refs/merge-requests/1238
      
  3. Guy Allard
    Posted January 15, 2010 at 7:51 pm | Permalink

    As of this date, I am still seeing the kind of effects described here:

    http://groups.google.com/group/gitorious/browse_thread/thread/5cd5a999aa86b3dd

    I see them by just pushing two different branches, and requesting one merge from each branch. If I then delete one merge request, the described behavior occurs.

  4. Posted August 21, 2012 at 3:58 pm | Permalink

    When I initially commented I clicked the “Notify me when new comments are added”
    checkbox and now each time a comment is added
    I get several e-mails with the same comment. Is there any way you can remove me
    from that service? Thank you!


3 Trackbacks

  1. By Awesome code review « The Gitorious Blog on November 6, 2009 at 11:48 am

    […] merge request with new commits after it has been submitted to the target repository (described in a separate post) As a Gitorious user you can now push new commits to a hidden branch in the target repository, […]

  2. […] Criar um merge request. […]

  3. By Nos bastidores do KDE: Bogdan Vatra on March 14, 2011 at 5:48 pm

    […] Criar um merge request. […]