Edgewall Software
Modify

Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#10676 closed enhancement (fixed)

GitPlugin: support "mergetag" field in commits

Reported by: Christian Boos Owned by: Christian Boos
Priority: normal Milestone: 1.0
Component: plugin/git Version: 0.13dev
Severity: normal Keywords: git
Cc: Branch:
Release Notes:

Support hidden "mergetag" field in git commits

API Changes:
Internal Changes:

Description

Starting with Git 1.7.9 when you pull a signed tag, git verifies the PGP signature and creates a special merge commit:

The resulting commit records the signed tag used for this validation in a hidden field so that it can later be used by others to audit the history. (see Using signed tag in pull requests)

Such commits are not supported currently (e.g. 2240a7b in the Linux git repository):

ValueError: need more than 0 values to unpack

File "c:/Trac/repos/trunk/trac/web/main.py", line 480, in _dispatch_request
  dispatcher.dispatch(req)
File "c:/Trac/repos/trunk/trac/web/main.py", line 198, in dispatch
  resp = chosen_handler.process_request(req)
File "c:/Trac/repos/trunk/trac/versioncontrol/web_ui/changeset.py", line 317, in process_request
  chgset = repos.get_changeset(new)
File "c:/Trac/repos/trunk/tracopt/versioncontrol/git/git_fs.py", line 430, in get_changeset
  return GitChangeset(self, rev)
File "c:/Trac/repos/trunk/tracopt/versioncontrol/git/git_fs.py", line 638, in __init__
  msg, props = repos.git.read_commit(sha)
File "c:/Trac/repos/trunk/tracopt/versioncontrol/git/PyGIT.py", line 748, in read_commit
  key, value = line.split(None, 1)

(line being u' ' here)

The content of the commit object is:

tree b19535236cfb6c64b798745dd3917dafc27bcd0a
parent 30aaca4582eac20a52ac7b2ec35bdb908133e5b1
parent 5a0dc7365c240795bf190766eba7a27600be3b3e
author Linus Torvalds <torvalds@linux-foundation.org> 1323915958 -0800
committer Linus Torvalds <torvalds@linux-foundation.org> 1323915958 -0800
mergetag object 5a0dc7365c240795bf190766eba7a27600be3b3e
 type commit
 tag tytso-for-linus-20111214A
 tagger Theodore Ts'o <tytso@mit.edu> 1323890113 -0500

 tytso-for-linus-20111214
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)

 iQIcBAABCAAGBQJO6PXBAAoJENNvdpvBGATwpuEP/2RCxmdWYZ8/6Z6pmTh3hHN5
 fx6HckTdvLQOvbQs72wzVW0JKyc25QmW2mQc5z3MjSymjf/RbEKihPUITRNbHrTD
 T2sP/lWu09AKLioEg4ucAKn/A7Do3UDIkXTszvVVP/t2psVPzLeJ1njQKra14Nyz
 o0+gSlnwuGx9WaxfR+7MYNs2ikdSkXIeYsiFAOY4YOxwwC99J/lZ0YaNkbI7UBtC
 yu2XLIvPboa5JZXANq2G3VhVIETMmOyRTCC76OAXjqkdp9nLFWDG0ydqQh0vVZwL
 xQGOmAj+l3BNTE0QmMni1w7A0SBU3N6xBA5HN6Y49RlbsMYG27aN54Fy5K2R41I3
 QXVhBL53VD6b0KaITcoz7jIGIy6qk9Wx+2WcCYtQBSIjL2YwlaJq0PL07+vRamex
 sqHGDejcNY87i6AV0DP6SNuCFCi9xFYoAoMi9Wu5E9+T+Vck0okFzW/luk/FvsSP
 YA5Dh+vISyBeCnWQvcnBmsUQyf8d9MaNnejZ48ath+GiiMfY8USAZ29RAG4VuRtS
 9DAyTTIBA73dKpnvEV9u4i8Lwd8hRVMOnPyOO785NwEXk3Ng08pPSSbMklW6UfCY
 4nr5UNB13ZPbXx4uoAvATMpCpYxMaLEdxmeMvgXpkekl0hHBzpVDey1Vu9fb/a5n
 dQpo6WWG9HIJ23hOGAGR
 =n3Lm
 -----END PGP SIGNATURE-----

Merge tag 'tytso-for-linus-20111214' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

* tag 'tytso-for-linus-20111214' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: handle EOF correctly in ext4_bio_write_page()
  ext4: remove a wrong BUG_ON in ext4_ext_convert_to_initialized
  ext4: correctly handle pages w/o buffers in ext4_discard_partial_buffers()
  ext4: avoid potential hang in mpage_submit_io() when blocksize < pagesize
  ext4: avoid hangs in ext4_da_should_update_i_disksize()
  ext4: display the correct mount option in /proc/mounts for [no]init_itable
  ext4: Fix crash due to getting bogus eh_depth value on big-endian systems
  ext4: fix ext4_end_io_dio() racing against fsync()

.. using the new signed tag merge of git that now verifies the gpg
signature automatically.  Yay.  The branchname was just 'dev', which is
prettier.  I'll tell Ted to use nicer tag names for future cases.

I have a fix for this, but was wondering if there were other such "hidden fields" to take into account, or if it would be worth having a more generic support for such multiline fields.

Besides, that signature information is not shown, maybe it would be useful to find a way to display it in the changeset view.

Attachments (0)

Change History (5)

comment:1 by Christian Boos, 13 years ago

comment:2 by Christian Boos, 13 years ago

After some refactoring, I've generalized the parsing to cope with any multiline field. Such a field counts for one value, so there can even be multiple values for such fields, or a mix (who knows what they'll do next ;-) ).

See branch:cboos.git@git/support-mergetag-alt (i.e. [6814953/cboos.git] waiting for branch syntax to be supported in a backend-neutral way).

comment:3 by Remy Blank, 13 years ago

Owner: set to Christian Boos

comment:4 by Christian Boos, 13 years ago

Resolution: fixed
Status: newclosed

comment:5 by Christian Boos, 12 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.