Skip to content

Conversation

@heartacker
Copy link
Contributor

No description provided.

@heartacker
Copy link
Contributor Author

PixPin_2025-07-30_11-20-28

@heartacker heartacker force-pushed the heartacker/issue1632 branch 4 times, most recently from 2859641 to 9d70904 Compare July 30, 2025 06:57
@goran-w
Copy link
Contributor

goran-w commented Aug 4, 2025

NOTE: A similar request (for a way to Clone a Custom Action) was recently brought up in this Discussion: #1479

@goran-w
Copy link
Contributor

goran-w commented Sep 4, 2025

@love-linger, @heartacker - This is an excellent (and very simple / straight-forward) feature which deserves merging ASAP.

However, it's so great that we should have the same feature for Issue Tracker rules (and Commit Template items) as well! 😉

@heartacker
Copy link
Contributor Author

@love-linger 已经根据社区意见修改。麻烦看看这个是否有新的看到,并review 下。谢谢哈


public CustomActionControl(CustomActionControl cac)
{
if (cac != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that you can assume that reference will not be null


public CustomAction(CustomAction action)
{
if (action != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that you can assume that reference will not be null

{
var act = new CustomAction(baseAct)
{
Name = baseAct.Name + " - (Copy)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be localizable


var action = new Models.CustomAction(SelectedCustomAction)
{
Name = SelectedCustomAction.Name + " - (Copy)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be localizable

@love-linger
Copy link
Collaborator

我并不想加入该功能。我认为在一个仓库中复制一个自定义动作是无意义的(它们不可能相同,且重新编辑一个又不耗费时间)。

I don't want to add this feature. I think it's meaningless to copy a custom action in a repository (they can't be the same, and it doesn't take time to re-edit one).

@love-linger
Copy link
Collaborator

对于此类需求,我自己来实现的话会是增加一个拷贝的操作(复制到剪贴板),允许从剪贴板创建。这样,就可以将某一个项目中已配置好的某些自定义操作直接拷贝到另一个仓库。

For such requirements, if I were to implement it myself, I would add a copy operation (copy to the clipboard) and allow creating a new one from the clipboard. In this way, user can copy existing custom action from one repository to another.

@heartacker
Copy link
Contributor Author

其实主要是有参数配置的部分会比较麻烦,复制来复制去,挺不自在的

尤其是有好几个参数,有描述有定制,一个个复制很麻烦。甚至很记住

当然,如果是一行命令行,那确实很简单。

@heartacker
Copy link
Contributor Author

增加一个拷贝的操作(复制到剪贴板),允许从剪贴板创建。

也是很好的主意,期待新的PR,

如果是这样的话,一个复制的按钮,也是不错的的,可以在用户点击复制按钮的时候,选复制到本repo 还是复制到 剪切板。

@goran-w
Copy link
Contributor

goran-w commented Dec 21, 2025

For this type of requirement, my own implementation would involve adding a copy operation (copy to clipboard) and allowing creation from the clipboard. This way, certain custom operations configured in one project can be directly copied to another repository.

I would much prefer having a Save & Load mechanism for transfer of Custom Actions / Issue Tracker rules / Commit Templates between repos, since that would also work between machines!

I would still, however, also keep the "Clone" mechanism proposed in this PR, since it's not for transfer but for quicker experimenting and creation of several similar or related actions / rules / templates.

@goran-w
Copy link
Contributor

goran-w commented Dec 22, 2025

I don't want to add this feature. I think it's meaningless to copy a custom action in a repository (they can't be the same, and it doesn't take time to re-edit one).

It's not meaningless, since the purpose is to make small changes to an existing Action in order to make a new variant.

Also, it can certainly take time to "re-edit" one, since it can potentially have several Input Controls and multiple command arguments (with variables) etc.

(For example, I recently created two very similar Actions, with nearly identical inputs and args but with different scope : "Rename remote branch" and "Rename remote tag". Having a Clone mechanism would have been very helpful when creating the 2nd one, since it was a bit tedious to copy individual settings from the 1st one.)

That's why I suggest two complementary mechanisms:

  • A "trivial" Clone mechanism (as in this PR) for quick-and-easy copy-then-edit functionality within the same editor panel.
  • A new Save & Load feature, for transfer of Actions between repo and global scope, between repo-tabs and between computers/users.

For consistency, the same type of functionality (at least the Clone mechanism) should be added to the editors for Issue Tracker rules and for Commit Templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants