From 782177ed3fb6b2c20ddaed75ec144fad72456666 Mon Sep 17 00:00:00 2001 From: Ram Date: Fri, 19 Aug 2022 10:39:40 +0530 Subject: [PATCH] feat: compare a file in different branches --- src/data/primary-options.js | 1 + src/data/secondary-options.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/data/primary-options.js b/src/data/primary-options.js index 43cb410..b1e3a86 100644 --- a/src/data/primary-options.js +++ b/src/data/primary-options.js @@ -7,6 +7,7 @@ const options = [ { value: 'show', label: 'show/view' }, { value: 'delete', label: 'delete/remove' }, { value: 'compareCommits', label: 'compare two commits' }, + { value: 'compareFileInDiffBranch', label: 'compare file in two branches' }, { value: 'configure', label: 'configure' }, { value: 'clone', label: 'clone' }, { value: 'ignore', label: 'ignore' }, diff --git a/src/data/secondary-options.js b/src/data/secondary-options.js index 9bf9e10..ba0ca43 100644 --- a/src/data/secondary-options.js +++ b/src/data/secondary-options.js @@ -217,6 +217,22 @@ export const secondaryOptions = { } ], + compareFileInDiffBranch: [ + { + value: 'terminal', + label: 'and output result in the terminal', + usage: 'git diff -- fileNameWithPath', + nb: 'Your current checked out branch and master are the branches where you want to compare the same file. fileNameWithPath is the file with relative path.' + }, + { + value: 'file', + label: 'and output result to a file', + usage: 'git diff -- filenamewithpath > diff.txt', + nb: + 'Your current checked out branch and master are the branches where you want to compare the same file. fileNameWithPath is the file with relative path. \n\ndiff.txt is the file you want to store the contents of the diff.' + } + ], + clone: [ { value: 'clone-repo-into-a-new-dir',