Add the repository name to .../changesets/public

Subscribe to Add the repository name to .../changesets/public 2 post(s), 2 voice(s)

 
Avatar wurldtech 2 post(s)

Currently, neither the summary nor the RSS information gives any indication of which repository a change is in, so I see things like:

[123] Rewrote feed code.
[342] Updated documentation on GDI
...

Even when looking at the RSS item for one of those changes, it still doesn’t say what repository the change was to. I might be able to figure out if the whole commit message was present, but since only the first 5 or so words is included, I’ve no context to know what was going on.

Please add an indication of what repository a change was against if its in a feed that includes changes from multiple repositories.

 
Avatar Morgan Schweers 16 post(s)

Greetings,
I’m not with AR, but I’ve made similar changes. I only use a single repository, so it’s not as critical to me (although the full commit message is important to me), but you could do this…

In app/views/changesets/_changesets.atom.builder, alter the entry.title line to start with something like:

entry.title("[#{@repositories.to_a.length > 1 ? changeset.repository.name + '-' + changeset.revision.to_s : changeset.revision}]...

The ’...’ of course means all the rest of the code that was currently on the line. The .to_a is to handle the potential for a nil @repositories (it just shows the revision in that case), and is mostly because I don’t know the code well enough to be sure it will or won’t be.

This way if there is more than one repository currently visible, it’ll show the repository name before the number.

That’s an RSS/Atom fix only, though… I imagine something similar could be done for index.html.erb.

— Morgan