Edgewall Software

Opened 12 years ago

Closed 12 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:


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
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

 Version: GnuPG v1.4.10 (GNU/Linux)


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, 12 years ago

comment:2 by Christian Boos, 12 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, 12 years ago

Owner: set to Christian Boos

comment:4 by Christian Boos, 12 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
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.