public class GitGui extends java.lang.Object
FileList
which contains the time stamp of all files.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
GitGui.RevisionEntry |
(package private) static class |
GitGui.Settings |
Modifier and Type | Field and Description |
---|---|
(package private) GralUserAction |
actionAdd
Action for show the version table for the given file.
|
(package private) GralUserAction |
actionCommit
Action for do commi.
|
(package private) GralUserAction |
actionDiffCurrWork
Action for diff view of the current file to the workspace.
|
(package private) GralUserAction |
actionExecCmd |
(package private) GralUserAction |
actionFileDiffRev
Action for diff view of the current file between revisions.
|
(package private) GralUserAction |
actionMove
Action for show the version table for the given file.
|
(package private) GralUserAction |
actionOnCloseWindow |
(package private) GralUserAction |
actionOpenCommitText
Action for open the commit text.
|
(package private) GralUserAction |
actionRefresh
Action for show the version table for the given file.
|
(package private) GralUserAction |
actionRestore
Action for mouse double to start view diff.
|
(package private) GralUserAction |
actionTableFile
Action for mouse double to start view diff.
|
(package private) GralUserAction |
actionTableFileDiffView
Action for mouse double to start view diff.
|
(package private) GralUserAction |
actionTableFileLog
Action for show the version table for the given file.
|
(package private) GralUserAction |
actionTableFileRenMove |
(package private) GralUserAction |
actionTableLineVersion |
(package private) boolean |
bCmdThreadClose
If set to true, the
cmdThread should be aborted. |
(package private) java.lang.Thread |
cmdThread |
(package private) GitGui.RevisionEntry |
cmpEntry
The current entry and the entry before, to the earlier commit.
|
(package private) GralTableLine_ifc<GitGui.RevisionEntry> |
cmpLine
The current line and the line before, to the earlier commit.
|
(package private) GitGui.RevisionEntry |
currentEntry
The current entry and the entry before, to the earlier commit.
|
(package private) GralTableLine_ifc<GitGui.RevisionEntry> |
currentLine
The current line and the line before, to the earlier commit.
|
(package private) java.text.SimpleDateFormat |
dateFormat
The presentation of the time stamps.
|
(package private) CmdExecuter.ExecuteAfterFinish |
exec_CommitDone
This code snippet is executed after the 'git diff' command for 2 revisions are executed.
|
(package private) CmdExecuter.ExecuteAfterFinish |
exec_fillFileTable4Revision
This code snippet is executed after the 'git diff' command for 2 revisions are executed.
|
(package private) CmdExecuter.ExecuteAfterFinish |
exec_fillRevisionTable
This code snippet is executed after the 'git diff' command for 2 revisions are executed.
|
(package private) CmdExecuter.ExecuteAfterFinish |
exec_ShowStatus
This code snippet is executed after the 'git diff' command for 2 revisions are executed.
|
(package private) CmdExecuter.ExecuteAfterFinish |
execShowListOut |
(package private) GitGuiPaths |
exepath
The paths to the executables.
|
(package private) static java.io.File |
filePathRepository
The only one opened git repository. null if nothing is open or more as one is open.
|
(package private) CmdExecuter |
gitCmd |
(package private) StringPartAppend |
gitOut
Destination for output of all command line invocations.
|
(package private) GralGraphicTimeOrder |
initGraphic |
(package private) java.util.List<java.lang.Appendable> |
listOut
The
CmdExecuter.execute(String[], boolean, String, List, List, org.vishia.cmd.CmdExecuter.ExecuteAfterFinish)
needs a list of appendable, that is it. |
(package private) GitGui.Settings |
settings |
(package private) java.lang.String |
sFileList |
(package private) java.lang.String |
sGitDir
Stored arguments from
startLog(String, String, String) . |
(package private) java.lang.String |
sLocalFile
If given the file which's log and diff should be shown.
|
(package private) java.lang.String |
sTypeOfImplementation |
java.lang.String |
sVersion
Version, history and license
2018-10-28 Hartmut new textfield for cmd, shows the last automatically cmd, enables assembled cmd for git and common cmd.
|
(package private) java.lang.String |
sWorkingDir
Stored arguments from
startLog(String, String, String) . |
(package private) GralButton |
wdgBtnAdd |
(package private) GralButton |
wdgBtnCmd |
(package private) GralButton |
wdgBtnDiffCurrFile |
(package private) GralButton |
wdgBtnDiffCurrWork |
(package private) GralButton |
wdgBtnMove |
(package private) GralTextField |
wdgCmd |
(package private) GralButton |
wdgCommit |
(package private) GralButton |
wdgCommitText |
(package private) GralTextBox |
wdgInfo |
(package private) GralButton |
wdgRefresh |
(package private) GralTable<java.lang.String> |
wdgTableFiles |
(package private) GralTable<GitGui.RevisionEntry> |
wdgTableVersion |
(package private) GralWindow |
window |
(package private) java.io.File |
workingDir |
Constructor and Description |
---|
GitGui(java.lang.String[] args) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addFileFromSelection() |
void |
doSomethinginMainthreadTillCloseWindow() |
(package private) void |
fillFileTable4Revision()
Fills the file table with the gotten output after git diff name-status command.
|
(package private) void |
fillRevisionTable()
Fills the
wdgTableVersion with the gotten output after git log command. |
void |
finalize() |
static java.io.File |
getFilePathRepository(java.io.File startFileSearchRepository)
Returns the opened repository or repoository linking file or searches the next .git or .gitRepository file
in the parent dir.
|
static void |
guiRepository(GitGuiPaths exepath,
JZtxtcmdFilepath repoFile)
Searches the git repository and the root of the working tree and opens the window for the git gui.
|
(package private) void |
initializeCmd() |
static void |
main(java.lang.String[] args) |
(package private) void |
moveFileListToSelection() |
(package private) void |
openNewFileSelector(java.lang.String sFile,
GitGui.RevisionEntry currRev) |
(package private) void |
restoreFile(java.lang.String sFile) |
static java.lang.String |
searchRepository(java.io.File startFile,
java.lang.String[] dst,
java.util.Map<java.lang.String,DataAccess.Variable<java.lang.Object>> dstMap,
java.lang.String nameRepository,
java.lang.String nameBasedir,
java.lang.String nameLocalFile)
Search the base dir and the repository for a given path/to/file.
|
(package private) void |
showLog_startRevisionDiff4FileTable(GralTable.TableLineData line)
Starts the command 'git diff' to fill the
wdgTableFiles for the selected revision. |
static void |
showLog(java.io.File srcFile)
Searches the git repository and the root of the working tree and opens the window for the git gui.
|
(package private) void |
startDiffView(java.lang.String sFile,
GitGui.RevisionEntry currRev,
GitGui.RevisionEntry cmpRev)
Gets the file from repository and writes to tmp directory, starts diff tool
|
(package private) void |
startLog(java.lang.String sLocalFile) |
void |
startLog(java.lang.String sGitDir,
java.lang.String sWorkingDir,
java.lang.String sLocalFile) |
public final java.lang.String sVersion
openNewFileSelector(String, RevisionEntry)
not ready yet.
diff --name-status instead diff --name-only
to build the input for the #wdgTableFiles to show different files. The table has an additional left row for the kind of difference
adequate the output of diff --name-status.
- 2018-10-10 Hartmut new
#guiRepository(JZtxtcmdFilepath)
as start operation. It checks whether "name.gitRepository" is given
and copies "name.gitignore" to ".gitignore" and uses "name.filelist" as filelist. It supports more as one component on one working dir.
- 2018-10-10 Hartmut new
getFilePathRepository(File)
. It is invoked in jzTc to get the opened repository by this GUI for add command.
- 2017-05-10 Hartmut bugfix
CmdExecuter.setCharsetForOutput(String)
to UTF-8 because git outputs cmd output in UTF-8
- 2016-12-02 Hartmut chg GitGui some improvements.
- 2016-09-23 Hartmut GitGui: ContextMenu in file table
- 2016-08-18 Hartmut this version is able to use to view the repository versions, the changed files per version, the changed file to the working tree.
It supports view diff with invocation of an external tool. It is the first productive version. But yet with some specific settings yet now.
TODO: read a config. Document it. Show the git command line for any action.
- 2016-08-24 Hartmut created
GralUserAction actionOpenCommitText
CmdExecuter.ExecuteAfterFinish exec_CommitDone
CmdExecuter.execute(String[], boolean, String, List, List, org.vishia.cmd.CmdExecuter.ExecuteAfterFinish)
and prepares the wdgTableFiles
.GralUserAction actionCommit
GralUserAction actionRefresh
GralUserAction actionTableLineVersion
CmdExecuter.ExecuteAfterFinish exec_fillRevisionTable
CmdExecuter.execute(String[], boolean, String, List, List, org.vishia.cmd.CmdExecuter.ExecuteAfterFinish)
and prepares the wdgTableFiles
.CmdExecuter.ExecuteAfterFinish exec_fillFileTable4Revision
CmdExecuter.execute(String[], boolean, String, List, List, org.vishia.cmd.CmdExecuter.ExecuteAfterFinish)
and prepares the wdgTableFiles
.CmdExecuter.ExecuteAfterFinish exec_ShowStatus
CmdExecuter.execute(String[], boolean, String, List, List, org.vishia.cmd.CmdExecuter.ExecuteAfterFinish)
and prepares the wdgTableFiles
.GralUserAction actionTableFile
GralUserAction actionRestore
GralUserAction actionTableFileDiffView
GralUserAction actionTableFileRenMove
GralUserAction actionDiffCurrWork
GralUserAction actionFileDiffRev
GralUserAction actionTableFileLog
GralUserAction actionExecCmd
GralUserAction actionAdd
GralUserAction actionMove
CmdExecuter.ExecuteAfterFinish execShowListOut
GitGuiPaths exepath
static java.io.File filePathRepository
GitGui.Settings settings
java.lang.String sTypeOfImplementation
GralWindow window
GralTextField wdgCmd
GralButton wdgBtnCmd
GralTable<GitGui.RevisionEntry> wdgTableVersion
GralTable<java.lang.String> wdgTableFiles
GralTextBox wdgInfo
GralButton wdgBtnDiffCurrWork
GralButton wdgBtnDiffCurrFile
GralButton wdgBtnAdd
GralButton wdgBtnMove
GralButton wdgRefresh
GralButton wdgCommitText
GralButton wdgCommit
boolean bCmdThreadClose
cmdThread
should be aborted.CmdExecuter gitCmd
StringPartAppend gitOut
java.util.List<java.lang.Appendable> listOut
CmdExecuter.execute(String[], boolean, String, List, List, org.vishia.cmd.CmdExecuter.ExecuteAfterFinish)
needs a list of appendable, that is it.java.lang.String sGitDir
startLog(String, String, String)
.java.lang.String sWorkingDir
startLog(String, String, String)
.java.io.File workingDir
java.lang.String sFileList
java.lang.String sLocalFile
startLog(String)
java.text.SimpleDateFormat dateFormat
GralTableLine_ifc<GitGui.RevisionEntry> currentLine
GralTableLine_ifc<GitGui.RevisionEntry> cmpLine
GitGui.RevisionEntry currentEntry
GitGui.RevisionEntry cmpEntry
GralGraphicTimeOrder initGraphic
GralUserAction actionOnCloseWindow
java.lang.Thread cmdThread
public GitGui(java.lang.String[] args)
public static void main(java.lang.String[] args)
public void finalize()
finalize
in class java.lang.Object
void initializeCmd()
public void doSomethinginMainthreadTillCloseWindow()
public static java.lang.String searchRepository(java.io.File startFile, java.lang.String[] dst, java.util.Map<java.lang.String,DataAccess.Variable<java.lang.Object>> dstMap, java.lang.String nameRepository, java.lang.String nameBasedir, java.lang.String nameLocalFile)
startFile
- Any file path. Especially a ".git" directory or ".gitRepository*" file. In that case the local file path will be set to null,
because the whole repository is given.
A ".gitRepository*" file contains the path to the extern .git directory.dst
- maybe null, elsewhere new String[2].
dst[0] will be filled with the absolute path of the .git directory.
dst[1] will be filled with the absolute path to the basic directory for the working tree where .git or .gitRepository were found.
dst[2] will be filled with the local file path or null if the .git or .gitRepositiory is the startFile.dstMap
- maybe null, if not null it is a container maybe from JZcmd variables or an empty Map.nameRepository
- if dstMap !=null, the name of the key (variable) for the repository path.nameBasedir
- if dstMap !=null, the name of the key (variable) for the base directory.nameLocalFile
- if dstMap !=null, the name of the key (variable) for the local file.
That variables will be set. nameLocalFile will be set to null if .git or .gitRepository is the startFile.public static java.io.File getFilePathRepository(java.io.File startFileSearchRepository)
dir
- The dir where a file should be handled.public static void guiRepository(GitGuiPaths exepath, JZtxtcmdFilepath repoFile)
srcFile
- Any file to start searching the root of the working tree and the git repository inside this tree.
If it is a directory and that directory contains either ".git" or ".gitRepository", it is the root of the working tree.
Elsewhere the root will be searched backward to the root of the file system.
It means you can start this routine with any srcFile inside the working tree.
This file will be used as additional argument for example to show the history of that file.public static void showLog(java.io.File srcFile)
srcFile
- Any file to start searching the root of the working tree and the git repository inside this tree.
If it is a directory and that directory contains either ".git" or ".gitRepository", it is the root of the working tree.
Elsewhere the root will be searched backward to the root of the file system.
It means you can start this routine with any srcFile inside the working tree.
This file will be used as additional argument for example to show the history of that file.public void startLog(java.lang.String sGitDir, java.lang.String sWorkingDir, java.lang.String sLocalFile)
void startLog(java.lang.String sLocalFile)
sLocalFile
- "*" for all files, else "path/in/loacal/tree/file.ext"void fillRevisionTable()
wdgTableVersion
with the gotten output after git log command. This routine is invoked as #execAfterCmdLog
.void showLog_startRevisionDiff4FileTable(GralTable.TableLineData line)
wdgTableFiles
for the selected revision.line
- void restoreFile(java.lang.String sFile)
void addFileFromSelection()
void moveFileListToSelection()
void startDiffView(java.lang.String sFile, GitGui.RevisionEntry currRev, GitGui.RevisionEntry cmpRev)
sFile
- The local path of the filecurrRev
- maybe null, then compare with working tree, elsewhere a selected revisioncmpRev
- the selected revision to compare.void openNewFileSelector(java.lang.String sFile, GitGui.RevisionEntry currRev)
void fillFileTable4Revision()
exec_fillFileTable4Revision
.