Many places on d.o link to individual commits, such as http://drupal.org/cvs?commit=480328.

Need a way to link to an individual commit using versioncontrol_operations.vc_op_id

Comments

dww’s picture

Issue tags: +git phase 2, +git sprint 9

See also #780342: Handle linkrot from CVS commit browser. I think we need this ASAP, but it's not technically a launch blocker, so I'm going to call it sprint 9...

sdboyer’s picture

One big question here is whether we should ever expose the vc_op_id in this way. Now that all projects reside in their own repositories, that number is even more artificial than it was before - and unnecessary, since commits can be referred to by their SHA. My strong preference would be to use the SHA; it's a real piece of data that can be determined without looking at d.o at all, rather than being the product of random autoinc. Also because the views, as we've designed them right now, use the SHA, not the autoinc id, to identify commits in the commitlog.

marvil07’s picture

Status: Active » Needs review
StatusFileSize
new2.09 KB

First step, let view know how to filter by the commit. Now, maybe on #780342: Handle linkrot from CVS commit browser redirect to the right URL?

dww’s picture

I don't care if it's op_id or hash. SHA sounds good for a variety of reasons. We just need something to link to. And yeah, over at #780342 we'll deal with redirecting.

marvil07’s picture

I think vc_op_id is ok for versioncontrol, if we use revision, we need to do it at versioncontrol_git, that have unique revisions per operation(for example cvs and svn do not have)

sdboyer’s picture

re: #5 - I've thought about this, actually. Only non-atomic systems (SVN is for sure atomic, it does have unique rev numbers) don't have a unique rev id of their own, and that's only CVS. There's no reason the generic can't implement the much-more-helpful revision id, and the CVS backend (if a new one ever gets written) overrides it and uses vc_op_id. That's one of the beauties of this system - the generic doesn't always _have_ to be the lowest common denominator.

marvil07’s picture

Re #6: Not sure, an overwritten views set for git using revision instead of vc_op_id seems like the better idea to me.

dww’s picture

@marvil07: if cvs is the only one that needs vc_op_id, and using the vc_op_revision is better in the general case (which it sounds like it is), I vote for sam's approach. No sense overly complicating this. Just because we have pluggable views sets doesn't mean we need to use them for everything. ;)

mikey_p’s picture

How about instead of an argument, we make this into an exposed filter without the form, or something like that. So either commitlog?verison=SHA1HASH or commitlog?vc_op_id=12345 would work.

dww’s picture

I'm not sure the hidden exposed filter is necessary. I still vote for an optional argument using revision, and vc_cvs can do otherwise. But, it really doesn't matter that much to me.

mikey_p’s picture

StatusFileSize
new12.57 KB

Here's a crack at including a separate view and view_set. The nice thing is we can go into more depth on the commit view here than we can in global lists and include any fields that don't fit there.

mikey_p’s picture

Status: Needs review » Fixed

Committed.

marvil07’s picture

Assigned: Unassigned » marvil07
Status: Fixed » Needs work

I am working on this to include repository as first argument.

We can not be sure that different repositories would have different revisions. For git(and other VCs that use hashes) is mostly improbable, but other VCS that have numeric identifiers would not have that, so filter by repository is needed.

marvil07’s picture

Category: task » feature
Status: Needs work » Needs review
StatusFileSize
new6.8 KB

Here the patch, it:

  • Add an argument for filter by repository in the individual_commit_view.
  • Modify the link shown on operation date handler.
mikey_p’s picture

This makes sense and is technically valid, although it kinda defeats part of the purpose of using the hash vs. vc_op_id, since repo_id is equally artificial and unnecessary as outlined in #2 above. I'd rather see vc_project override this with version that uses the project->uri instead of repo_id. I'm not setting this back to 'needs work' but I think this need further discussion/plan before proceeding.

marvil07’s picture

I agree that vc_project could offer a view based on this one that use project->uri instead of repo_id.

But please note that the reason for having this in is:

We can not be sure that different repositories would have different revisions.

, I mean VCSs that do not use hashes are too prone to have too many duplicates and that's enough reason for me to have this in.

Please remember that we are trying to build a reusable system, if we end up too d.o specific we are losing a lot of help/feedback from community.

sdboyer’s picture

I read http://warpspire.com/posts/url-design/ recently, and it really struck a chord. Happens to be from githubbers, but that's really incidental here, it could be from anyone with a heavily data-driven website.

Really, my preference is for more, _real_ information in the URI as possible. We can't use repository name, as that's not guaranteed to be unique anymore (correctly), but we could use the uri from vc_project, as you've both pointed out. For the final view that's presented, I'd like to have the uri & the blob, as they're the real, user-facing data.

We're increasingly getting into a position where the views provided directly by commitlog are a liability. I'm thinking we want a way to selectively disable them, so that commitlog can be enabled but not all of its views (sets) are given menu entries. Sounds like a feature to be added to views sets.

marvil07’s picture

So, does it mean RTBC?

sdboyer’s picture

Status: Needs review » Reviewed & tested by the community

Sorry. Yes, RTBC.

marvil07’s picture

Status: Reviewed & tested by the community » Fixed

Ok, patch committed.

Now we need another issue for doing the project uri relation on vc_project.

marvil07’s picture

Status: Fixed » Closed (fixed)
Issue tags: -git phase 2, -git sprint 9

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 7b55374 on repository-families, drush-vc-sync-unlock by mikey_p:
    #1024960 by mikey_p: View for an individual commit
    
    
  • Commit f60c83d on repository-families, drush-vc-sync-unlock by mikey_p:
    Followup to #1024960 by mikey_p: Provide handler to link from commit...
  • Commit 766ea10 on repository-families, drush-vc-sync-unlock by mikey_p:
    Followup to #1024960 by mikey_p: Make default commitlog views provide...
  • Commit 40a0452 on repository-families, drush-vc-sync-unlock by marvil07:
    task #1024960 follow-up: Need view for individual commit message.
    
    - Add...

  • Commit 7b55374 on repository-families by mikey_p:
    #1024960 by mikey_p: View for an individual commit
    
    
  • Commit f60c83d on repository-families by mikey_p:
    Followup to #1024960 by mikey_p: Provide handler to link from commit...
  • Commit 766ea10 on repository-families by mikey_p:
    Followup to #1024960 by mikey_p: Make default commitlog views provide...
  • Commit 40a0452 on repository-families by marvil07:
    task #1024960 follow-up: Need view for individual commit message.
    
    - Add...