mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	feat: add button to quickly clear merge message (#21548)
This PR adds a button to allow quickly clearing the merge message of a PR. The button will remove everything but the git trailers. I found myself often pruning the commit message before merging, especially for PRs generated by renovate - renovate puts a very long and detailed comment with the full changelog in each PR it opens. This clutters the commit message. However, I want to explicitly preserve the git commit trailers. Doing this manually works, but having a button is a lot easier. Screenshot:  Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
		@@ -25,6 +25,14 @@
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="field">
 | 
			
		||||
            <textarea name="merge_message_field" rows="5" :placeholder="mergeForm.mergeMessageFieldPlaceHolder" v-model="mergeMessageFieldValue"/>
 | 
			
		||||
            <template v-if="mergeMessageFieldValue !== mergeForm.defaultMergeMessage">
 | 
			
		||||
              <button @click.prevent="clearMergeMessage" class="ui tertiary button">
 | 
			
		||||
                {{ mergeForm.textClearMergeMessage }}
 | 
			
		||||
              </button>
 | 
			
		||||
              <div class="ui label"><!-- TODO: Convert to tooltip once we can use tooltips in Vue templates -->
 | 
			
		||||
                {{ mergeForm.textClearMergeMessageHint }}
 | 
			
		||||
              </div>
 | 
			
		||||
            </template>
 | 
			
		||||
          </div>
 | 
			
		||||
        </template>
 | 
			
		||||
 | 
			
		||||
@@ -174,6 +182,9 @@ export default {
 | 
			
		||||
      this.mergeStyle = name;
 | 
			
		||||
      this.autoMergeWhenSucceed = autoMerge;
 | 
			
		||||
    },
 | 
			
		||||
    clearMergeMessage() {
 | 
			
		||||
      this.mergeMessageFieldValue = this.mergeForm.defaultMergeMessage;
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user