Page MenuHomePhabricator

[Task] Improve the function for merging items
Closed, DuplicatePublic


This function is far from perfect. It produces incomplete merges and leaves semi-empty useless items behind, which actually are not so easy to find. AFAIK, currently @Pasleim's bot watches the recently performed merges and finishes incomplete merge actions. But this is not a solution for this problem.
The function responsible for merging must be improved to perform complete merges: after the merge action, the source item must be checked and if it's not redirect, then do clear it and redirect to the target item. This should be at least optional, if not mandatory.

Event Timeline

My bot is checking recentchanges for edit summaries containing \/\* wbmergeitems-to:0\|\|(Q[0-9]+) \*\/
For each match, it checks if a redirect was created. If not, the bot does the following:

  1. it merges the item again with ignoreconflicts=descriptions
  2. it clears the item
  3. it creates the redirect.

This is done with the same procedure since 2015 and it has not led to any user complaints. Based on this experience, I think it is safe to call by default after a merge the clear and createredirect functions.

While the current behavior is indeed not perfect, simply throwing away unmerged data doesn't seem like a viable option. This would have to be an interactive step, which requires a complex UI and much user interaction.

It would be helpful to identify any cases that could be handled automatically in a non-destructive way, but currently are not.

@Pasleim so your bot just throws away data? This data is not redundant - if it was, it would have been merged.

The only data my bot throws away are descriptions if the merge is done with QuickStatements or the client sitelink widget, see table below.

Toolsitelink conflictdescription conflict
Gadgetno mergemerge -> trash leftover descriptions -> redirect
Special:MergeItemsno mergeno merge
QuickStatementsno mergemerge but no redirect
client sitelink widgetno mergemerge but no redirect

Descriptions are little valuable data in case a second description exist in the same language. On the other hand, redirects are important such that links still point to something useful.

@Pasleim Thank you for the explanation!

So perhaps this request could be rephrased to say "ignore conflicting descriptions when merging items"? It's much easier to discuss and decide a concrete request like that. "Improve" could mean anything.