🇮🇷 Iran Proxy | https://www.wikipedia.org/wiki/Template_talk:Merging
Jump to content

Template talk:Being merged

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Template talk:Merging)

History

[edit]

Is merged. Should be clear with that knowledge what is what. Rich Farmbrough, 14:56, 14 September 2010 (UTC).[reply]

(Note: This was originally posted on Template talk:Merging from and probably referred to the history of Template:Merging from and related templates.) — Chrisahn (talk) 10:44, 22 November 2025 (UTC)[reply]

Similar template

[edit]

@Trialpears: Looking again at this, I wonder whether we need this template and Template:Merging. Klbrain (talk) 18:49, 16 October 2019 (UTC)[reply]

Klbrain How could I forget about that! Yep they're intended for the same purpose with the main difference being the categorization, which is basically useless for {{merging}} since it places it together with all the thousands of proposals without consensus. I will take care of it tomorrow. I don't think a whole TfD should be necessary. --Trialpears (talk) 21:55, 16 October 2019 (UTC)[reply]
The categorization process is helpful, though; keeping a (hopefully small) list of mergers ready to be completed. So, I'm sitting on the fence ... Klbrain (talk) 22:10, 16 October 2019 (UTC)[reply]
I was planning on changing it to Category:Articles currently being merged, which is what {{Being merged}} is currently using. --Trialpears (talk) 22:15, 16 October 2019 (UTC)[reply]
That sounds like a good idea. Klbrain (talk) 07:38, 17 October 2019 (UTC)[reply]

Broken template compatibility

[edit]

Soumya-8974 I think your recent changes broke the namespace detection that ensured {{Being deleted}} was invoked in template space. This used to be a redirect there and I think we should keep it working since in many cases the template is being merged and not deleted. One example of an affected page is {{Infobox name module}}. Could you take a look at this? ‑‑Trialpears (talk) 22:40, 30 April 2020 (UTC)[reply]

Does this template need page type switches?

[edit]

Hey! I can't really think of a significant or reasonable reason why {{Being merged}} needs a switch for different page types - is this template really being used in non-article pages? ItsPugle (please ping on reply) 09:14, 9 November 2020 (UTC)[reply]

ItsPugle, it used to be a redirect to {{Being deleted}} which is used for TfDs and used to be backwards compatible using switches when I created it. Looks like someone removed that feature though. --Trialpears (talk) 09:21, 9 November 2020 (UTC)[reply]
@Trialpears: Hm, I think {{Being deleted}} is a significantly different template here. {{Being merged}} has its own place I feel. Apart from its historical use with TfD, is {{Being merged}} used on any other non-article pages? ItsPugle (please ping on reply) 09:56, 9 November 2020 (UTC)[reply]
ItsPugle, Tep, currently it's used at MOS:ROMANIZATION and it may be used for other non-article mergers in the future. --Trialpears (talk) 10:33, 9 November 2020 (UTC)[reply]
@Trialpears: 👍 I'll have a crack at improving how it works for non-article pages. ItsPugle (please ping on reply) 09:27, 10 November 2020 (UTC)[reply]

Test of the message

[edit]

A minor point, but I wonder whether it might be better to "merge this page to" rather than "merge this page with" when a 'target' is set; it's helpful for readers to see the intended direction. Klbrain (talk) 10:09, 6 September 2023 (UTC)[reply]

 Done FaviFake (talk) 09:12, 22 November 2025 (UTC)[reply]

Confusing logic, part 1

[edit]

I think there are some issues with the logic that decides whether to use the target or the unnamed parameters. What's the intended behavior? I can specify a target parameter, or I can use unnamed parameters. What if I use both? Is that allowed? What will the template do in this case? Come to think of it, do we even need the target parameter? We also have a dir parameter that can be "from" or "to". I guess I understand what target means when dir is "to", but what if it's "from"? Maybe it would be better to drop the target parameter and tell users to always use dir and unnamed parameters. Or if we want to keep target while it's still in use somewhere, mark it as deprecated. — Chrisahn (talk) 03:11, 22 November 2025 (UTC)[reply]

@Chrisahn I introduced that logic to prevent breakage from the old template usage; target used to be a synonym for unnamed 1, and there appears to be quite a few instances of its usage, still. On the other hand, {{merge}} had a different meaning for target, and my implementation allows for both versions:
  • if no unnamed is provided, target functions as if it were unnamed 1 (regardless of dir), just as in the old usage
  • if both are provided, and no dir is provided, then target functions as the destination, just as it does in {{merge}}
The intended function is the latter, while the former is deprecated. ~ oklopfer (💬) 03:58, 22 November 2025 (UTC)[reply]
What if unnamed, target, and dir are provided? More generally, your description seems to say that dir is useless in either of the two cases you mentioned – in the first case, it's ignored, in the second case, it's disallowed. I'm still confused. :-) — Chrisahn (talk) 04:07, 22 November 2025 (UTC)[reply]
in that case target becomes ignored; it is only useful either when there is no unnamed, or when specifying a destination for multiple articles like in {{merge}}; the idea is for {{merge}}/{{merge to}}/{{merge from}} to be able to be drop-in replaced by {{being merged}}/{{being merged to}}/{{being merged from}} ~ oklopfer (💬) 04:13, 22 November 2025 (UTC)[reply]
and it's not ignored in the first scenario! my point is that if you combine target and dir, without unnamed, then it functions exactly as it did before; i.e. Being merged|dir=to|target=destination ~ oklopfer (💬) 04:16, 22 November 2025 (UTC)[reply]
Now I'm even more confused.
  • {{Merge}}, {{Merge from}} and {{Merge to}} don't have a dir parameter.
  • {{Merge from}} and {{Merge to}} don't have a target parameter.
  • {{Merge}} requires unnamed parameters. Its target parameter is optional; if it is present, "to target" is added to the output.
Chrisahn (talk) 04:30, 22 November 2025 (UTC)[reply]
  • not yet! I am working on it :)
  • correct - again, target is only meant for the deprecated old use when dir is provided
  • yes, that is how it works if you do being merged|a|target=b
~ oklopfer (💬) 04:50, 22 November 2025 (UTC)[reply]
I think it might be better to implement {{Being merged to}} and {{Being merged from}} as separate templates that don't invoke {{Being merged}}. Similar to {{Merge to}} and {{Merge from}}. Because it has to handle invocations from the other two templates, the logic in {{Being merged}} is complex and unreadable. In contrast, {{Merge}}, {{Merge to}} and {{Merge from}} are rather simple. Sure, there's a good deal of copied code, but I think that's easier to deal with than the complexity. — Chrisahn (talk) 04:52, 22 November 2025 (UTC)[reply]
I'll let more discussion play out as I saw you left some comments on the other talk page, but if it is too confusing then I am happy to re-split them; the only problem is that {{being merged}} had the dir param before I even touched it, so there are a lot of cases of it in current usages of the template ~ oklopfer (💬) 05:08, 22 November 2025 (UTC)[reply]
According to https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=Being+merged, dir is used in 47 pages. Or that was the case on 2025-11-01, if I understand correctly. I think these could be replaced by {{Being merged to}} and {{Being merged from}}. Shouldn't take too long. I'd be happy to help. — Chrisahn (talk) 05:17, 22 November 2025 (UTC)[reply]
To implement {{Being merged to}} and {{Being merged from}} as separate templates, we simply have to copy the code of {{Merge to}} and {{Merged from}} and change a bit of text, right? — Chrisahn (talk) 05:18, 22 November 2025 (UTC)[reply]
Wait, what would be the benefit in having 3 different codebases instead of 1? {{being merged from}} was already a wrapper and it has always worked fine afaik.
The thing I find very annoying is having to edit three different templates, as I've had to do multiple times with {{Merge}}, {{Merge from}}, and {{Merge to}}, for every simple change i want to make, or to copy over a change that someone made to 1 but (understandably) forgot to make to the other 2. FaviFake (talk) 09:22, 22 November 2025 (UTC)[reply]
Yes, code duplication is a nuisance, but so is code complexity. It's a trade-off. In this case, I think the complexity of {{Being merged}} is too high, and the duplication is preferrable. The code of {{Being merged}} is a mess of several nested ifs and switches. It's very hard to read and edit. The code of the separate templates {{Merge}}, {{Merge from}} and {{Merge to}} is much simpler. A mistake like the one describe in "part 2" is less likely to happen with simpler code.
If we implement {{Being merged from}} and {{Being merged to}} as separate templates, we can get rid of the complex logic we're discussing here. {{Being merged}} would then become very similar to {{Merge}}, which is much simpler. Right now, there are many different combinations of dir, target and unnamed parameters, and complex rules for how {{Being merged}} behaves in each case. Oklopfer tried to explain them above, but I still don't quite understand them. It will be difficult to document them. It will be difficult for users to understand them. It will be difficult for maintainers of the template to make sure that these rules are not broken.
The wrapper approach also leads to more code in total, though it's not a big difference:
Chrisahn (talk) 10:03, 22 November 2025 (UTC)[reply]
I've made the code of {{Being merged}} more readable in Special:Diff/1323538384 and added hidden comments. FaviFake (talk) 10:12, 22 November 2025 (UTC)[reply]
Thanks, that's a big improvement. I still find it hard to tell where the {{#if:{{{1|}}} ends and where its else-block starts, but I guess there's no much we can do about that. That's just template syntax. — Chrisahn (talk) 17:17, 22 November 2025 (UTC)[reply]
For example, if they were separated, the suggestion in § Confusing logic, part 2 would've had to be implemented thrice. FaviFake (talk) 09:30, 22 November 2025 (UTC)[reply]
If the "Being merged" templates were implemented like the "Merge" templates, we would have had to fix that problem at most once: only on {{Being merged}}, because the other two don't contain the if clause. But maybe the mistake would never have occurred, because the code would have been much simpler, easier to read, and easier to edit. — Chrisahn (talk) 09:40, 22 November 2025 (UTC)[reply]
I personally prefer 1 main template over 3 that need to be updated every time for any change. The code doesn't seem excessively complex to me. FaviFake (talk) 09:52, 22 November 2025 (UTC)[reply]
These templates are not edited often. Each of the "Merge" templates has been edited about 230 times in 21 years, less than once per month. Making such a rare change three times is no big deal.
I think most editors would find it difficult to edit a template like {{Being merged}}, especially since they don't edit it often, and they're likely to forget the details of its logic until the next time, which leads to mistakes and/or more time spent grappling with complexity.
But in the end, it's a matter of taste / habit. I've been writing code for decades in many different languages, but most of them use indentation and clear syntax. Mediawiki template syntax is not quite as bad as Brainfuck, but it's much worse than, say, Lisp's closing brackets. But I guess others may find template syntax easier to read. — Chrisahn (talk) 10:19, 22 November 2025 (UTC)[reply]
Back to my original question: How is {{Being merged}} supposed to behave in each case? As far as I can tell, the documentation is outdated. How will we document the behavior for each combination of dir, target and unnamed parameters? Should we make a table of all combinations and explain the behavior for each case?
If I understand correctly, target must only be used when {{Being merged}} is used directly on a page. Is it required or optional in that case?
On the other hand, is the dir parameter useful when {{Being merged}} is used directly on a page? I guess not, because this template should only be used when the direction of the merge hasn't been decided (yet).
Writing this, I get the impression that the rules for the use of {{Being merged}} are quite different from the rules for {{Being merged from}} and {{Being merged to}}, which indicates that it may make more sense to keep them separate.
The complexity of {{Being merged}} seems to stem from the fact that it has two roles: It has to implement the logic of the other two templates, but it must also be usable as a standalone template. Stuff like that leads to trouble. See Separation of concerns. — Chrisahn (talk) 10:35, 22 November 2025 (UTC)[reply]
The doc on my downstream provides a lot of different examples, but also demonstrates that it has ballooned in complexity and there may very well be grounds for separation. Hopefully it makes the distinction between unnamed + target clearer, though. ~ oklopfer (💬) 17:07, 22 November 2025 (UTC)[reply]
Thanks, looks good! Here are some ideas that could simplify the documentation (and hopefully the implementation as well):
  • We could declare dir a "private" parameter that must only be used by {{Being merged to}} and {{Being merged from}}. Then we can remove it from the main documentation and only mention it in an addendum aimed at maintainers of these two templates.
  • As far as I can tell, target is only needed for one specific case: When {{Being merged}} is used with one or more unnamed parameters and a target to produce the message "this page is being merged with A and B into C". If that's correct, we could disallow its use with the other two templates.
Maybe there are template invocations that break these rules, but I hope we could fix them with not too much effort.
Chrisahn (talk) 17:30, 22 November 2025 (UTC)[reply]
To the second bullet - yes, that is exactly the primary use for target (now); anywhere else, it is simply maintaining its deprecated function as an alias for 1, and could easily be disallowed for future uses. It would very much be preferable for it to not serve both of these functions, if we can clean up those situations where it is currently being used in a deprecated manner (ie simply removing the text target= and leaving the rest).
As for making dir hidden to the base template, that too feels preferable, though also would take quite a bit of cleanup; see Special:Diff/1323561195 for example, as it appears you are in an 'edit war' with a bot in trying to repair these situations :P ~ oklopfer (💬) 19:58, 22 November 2025 (UTC)[reply]
Thanks for the heads-up regarding the bot! I reverted the bot's changes and removed {{Subst only}} from {{Being merged to}} and {{Being merged from}}. That should stop the bot, and it makes sense: I think these templates should not be substituted. Or is there a reason why they should? — Chrisahn (talk) 20:17, 22 November 2025 (UTC)[reply]
If we are trying to keep them distinguished, I really don't see a reason for the substitution either. This way definitely makes more sense, and is closer in line with the separation of {{merge}} / {{merge to}} / {{merge from}} ~ oklopfer (💬) 20:39, 22 November 2025 (UTC)[reply]
Huh, I didn't even know they were set to always subst! That seems like a misconfiguration. FaviFake (talk) 21:15, 22 November 2025 (UTC)[reply]
good news @Chrisahn - there are now no more articles using target in the deprecated manner (as an alias for 1)! We can now work to clean up the code to remove this former usage of it (edit: which I've now done), so that it is only useful for the intended case of A and B into C as it is in {{merge}} ~ oklopfer (💬) 05:53, 4 December 2025 (UTC)[reply]

Confusing logic, part 2

[edit]

This code seems strange: {{#if:{{Pagelist .... Why do we invoke {{Pagelist}} just to test whether it returns an empty string? If I understand correctly, the invocation of {{Pagelist}} returns an empty string if all the numbered parameters are empty. If that's correct, we can replace {{#if:{{Pagelist ... by {{#if:{{1|}}| .... (Strictly speaking, we'd have to test all numbered parameters, because someone could invoke the template using {{Being merged|2=...}} or something similar, but I think we can ignore such corner cases.) — Chrisahn (talk) 03:20, 22 November 2025 (UTC)[reply]

The {{#if:{{Pagelist ... code was introduced in Special:Diff/1323264746, which also introduced similar {{Pagelist ... invocations in several other places. Maybe it was search-and-replace error? — Chrisahn (talk) 03:23, 22 November 2025 (UTC)[reply]
Wasn't necessarily a search and replace error, more so just a remnant from my tinkering to make pagelist work with the template, as it could only take a singular article input before. {{#if:{{1|}}| would indeed make much more sense to use there, pagelist is overkill ~ oklopfer (💬) 04:05, 22 November 2025 (UTC)[reply]
OK, I went ahead and changed it. Hopefully won't break anything. — Chrisahn (talk) 04:30, 22 November 2025 (UTC)[reply]
Thanks! FaviFake (talk) 09:29, 22 November 2025 (UTC)[reply]

Always inactive

[edit]

@FaviFake: Your edit didn't make |inactive= the default, it effectively made it always on. Was this intentional? jlwoodwa (talk) 00:10, 23 November 2025 (UTC)[reply]

Sorry if it wasn't clear! Yes, it was intentional, since the merging instructions actually recommend using a completely different template if the merge is currently being carried out. FaviFake (talk) 07:31, 23 November 2025 (UTC)[reply]
I think WP:M5 is talking about putting {{in use}}/{{in use section}} on the article being merged to. jlwoodwa (talk) 03:41, 24 November 2025 (UTC)[reply]
I didn't read it that way. {{in use}} says do not edit it while this notice is displayed, which is our objective. Instead, this template says "You can carry out the merge by following ..., which is not what we want (2 editors merging a page at the same time). FaviFake (talk) 16:17, 24 November 2025 (UTC)[reply]