Переглянути джерело

1)修复了do_sys无法[END]的问题
2)加入log的输出参数
3)命令增加了echo输出
4)增加了branch -vv输出
5)删除、清空暂存区

Huan 5 роки тому
батько
коміт
1c92307c74
2 змінених файлів з 147 додано та 78 видалено
  1. 75 30
      GIT.py
  2. 72 48
      Git_Ctrl.py

+ 75 - 30
GIT.py

@@ -65,7 +65,7 @@ def Main():
     a_y += 4
     a_y += 4
     tkinter.Button(top, bg=bbg, fg=fg, text='添加暂存区文件', command=Add_File, font=FONT, width=width_B,
     tkinter.Button(top, bg=bbg, fg=fg, text='添加暂存区文件', command=Add_File, font=FONT, width=width_B,
                    height=height_B).grid(column=a_x, row=a_y, sticky=tkinter.E + tkinter.W)
                    height=height_B).grid(column=a_x, row=a_y, sticky=tkinter.E + tkinter.W)
-    tkinter.Button(top, bg=bbg, fg=fg, text='移除暂存区文件', command=init_git, font=FONT, width=width_B,
+    tkinter.Button(top, bg=bbg, fg=fg, text='移除暂存区文件', command=Reset_File, font=FONT, width=width_B,
                    height=height_B).grid(column=a_x+1, row=a_y, sticky=tkinter.E + tkinter.W)
                    height=height_B).grid(column=a_x+1, row=a_y, sticky=tkinter.E + tkinter.W)
     tkinter.Button(top, bg=bbg, fg=fg, text='提交到git', command=Commit_File, font=FONT, width=width_B,
     tkinter.Button(top, bg=bbg, fg=fg, text='提交到git', command=Commit_File, font=FONT, width=width_B,
                    height=height_B).grid(column=a_x+2, row=a_y, sticky=tkinter.E + tkinter.W)
                    height=height_B).grid(column=a_x+2, row=a_y, sticky=tkinter.E + tkinter.W)
@@ -73,11 +73,21 @@ def Main():
     a_y += 1
     a_y += 1
     tkinter.Button(top, bg=bbg, fg=fg, text='查看执行日志', command=lambda :not_Args(Git.reflog), font=FONT, width=width_B,
     tkinter.Button(top, bg=bbg, fg=fg, text='查看执行日志', command=lambda :not_Args(Git.reflog), font=FONT, width=width_B,
                    height=height_B).grid(column=a_x, row=a_y, sticky=tkinter.E + tkinter.W)
                    height=height_B).grid(column=a_x, row=a_y, sticky=tkinter.E + tkinter.W)
-    tkinter.Button(top, bg=bbg, fg=fg, text='查看文件日志', command=lambda :not_Args(Git.log), font=FONT, width=width_B,
+    tkinter.Button(top, bg=bbg, fg=fg, text='查看文件日志', command=log, font=FONT, width=width_B,
                    height=height_B).grid(column=a_x+1, row=a_y, sticky=tkinter.E + tkinter.W)
                    height=height_B).grid(column=a_x+1, row=a_y, sticky=tkinter.E + tkinter.W)
     tkinter.Button(top, bg=bbg, fg=fg, text='查看状态', command=lambda :not_Args(Git.status), font=FONT, width=width_B,
     tkinter.Button(top, bg=bbg, fg=fg, text='查看状态', command=lambda :not_Args(Git.status), font=FONT, width=width_B,
                    height=height_B).grid(column=a_x+2, row=a_y, sticky=tkinter.E + tkinter.W)
                    height=height_B).grid(column=a_x+2, row=a_y, sticky=tkinter.E + tkinter.W)
 
 
+    global log_Type
+    a_y += 1
+    log_Type = []
+    lable = ['显示轴','commit完全显示','简化显示']#复选框
+    for i in range(3):
+        log_Type.append(tkinter.IntVar())
+        tkinter.Checkbutton(top,bg = bg,fg = fg,activebackground=bg,activeforeground=fg,selectcolor=bg, text=lable[i],
+                            variable=log_Type[-1]).grid(column=a_x+i, row=a_y, sticky=tkinter.W)
+        log_Type[-1].set(1)
+
     a_y += 1
     a_y += 1
     tkinter.Button(top, bg=bbg, fg=fg, text='版本回退', command=Back_version, font=FONT, width=width_B,
     tkinter.Button(top, bg=bbg, fg=fg, text='版本回退', command=Back_version, font=FONT, width=width_B,
                    height=height_B).grid(column=a_x, row=a_y, sticky=tkinter.E + tkinter.W)
                    height=height_B).grid(column=a_x, row=a_y, sticky=tkinter.E + tkinter.W)
@@ -235,21 +245,21 @@ def Main():
     tkinter.Button(top, bg=bbg, fg=fg, text='工作区列表', command=lambda :not_Args(Git.Stash_List), font=FONT, width=width_B,
     tkinter.Button(top, bg=bbg, fg=fg, text='工作区列表', command=lambda :not_Args(Git.Stash_List), font=FONT, width=width_B,
                    height=height_B).grid(column=a_x+2, row=a_y, sticky=tkinter.E + tkinter.W)
                    height=height_B).grid(column=a_x+2, row=a_y, sticky=tkinter.E + tkinter.W)
 
 
-    global Customize_Input, th_do, wait_do
-    a_y += 1
-    th_do = tkinter.Variable()
-    wait_do = tkinter.Variable()
-    tkinter.Checkbutton(top, bg=bg, fg=fg, activebackground=bg, activeforeground=fg, selectcolor=bg, text='多进程刷新',
-                        variable=th_do).grid(column=0, row=a_y, sticky=tkinter.W)
-    tkinter.Checkbutton(top, bg=bg, fg=fg, activebackground=bg, activeforeground=fg, selectcolor=bg, text='异步显示',
-                        variable=wait_do).grid(column=1, row=a_y, sticky=tkinter.W)
-    Customize_Input = tkinter.Entry(top, width=width_B * 3)
-    Customize_Input.grid(column=2, row=a_y, columnspan=4, sticky=tkinter.E + tkinter.W + tkinter.N + tkinter.S)
-
-    tkinter.Button(top, bg=bbg, fg=fg, text='执行操作', command=Customize, font=FONT, width=width_B,
-                   height=height_B).grid(column=a_x+2, row=a_y, sticky=tkinter.E + tkinter.W)
-    th_do.set(0)
-    wait_do.set(1)
+    # global Customize_Input, th_do, wait_do
+    # a_y += 1
+    # th_do = tkinter.Variable()
+    # wait_do = tkinter.Variable()
+    # tkinter.Checkbutton(top, bg=bg, fg=fg, activebackground=bg, activeforeground=fg, selectcolor=bg, text='多进程刷新',
+    #                     variable=th_do).grid(column=0, row=a_y, sticky=tkinter.W)
+    # tkinter.Checkbutton(top, bg=bg, fg=fg, activebackground=bg, activeforeground=fg, selectcolor=bg, text='异步显示',
+    #                     variable=wait_do).grid(column=1, row=a_y, sticky=tkinter.W)
+    # Customize_Input = tkinter.Entry(top, width=width_B * 3)
+    # Customize_Input.grid(column=2, row=a_y, columnspan=4, sticky=tkinter.E + tkinter.W + tkinter.N + tkinter.S)
+    #
+    # tkinter.Button(top, bg=bbg, fg=fg, text='执行操作', command=Customize, font=FONT, width=width_B,
+    #                height=height_B).grid(column=a_x+2, row=a_y, sticky=tkinter.E + tkinter.W)
+    # th_do.set(0)
+    # wait_do.set(1)
     TagMessage = commit_m
     TagMessage = commit_m
     TagCommit = CommitName
     TagCommit = CommitName
     RemoteBranch = BranchNOrigin
     RemoteBranch = BranchNOrigin
@@ -435,9 +445,10 @@ def Back_version():
     do_Sys(Git.back_version,(get_Name(),HEAD))
     do_Sys(Git.back_version,(get_Name(),HEAD))
     update_Git_Dir()
     update_Git_Dir()
 
 
-def do_Sys(func,args,name='CoTan Git',break_time=2,show=True,text_n='',th=False,wait=False):
+def do_Sys(func,args,name='CoTan Git',break_time=0,show=True,text_n='',th=False,wait=False,stop=True):
     p = func(*args)
     p = func(*args)
     flat = True
     flat = True
+    stopKey = Git_Ctrl.stopKey
     def Out_Txt():
     def Out_Txt():
         nonlocal data
         nonlocal data
         dic = asksaveasfilename(title='选择文件保存位置',filetypes=[("TXT", ".txt")])
         dic = asksaveasfilename(title='选择文件保存位置',filetypes=[("TXT", ".txt")])
@@ -449,14 +460,24 @@ def do_Sys(func,args,name='CoTan Git',break_time=2,show=True,text_n='',th=False,
             dic += '.txt'
             dic += '.txt'
         with open(dic,'w',encoding='utf-8') as f:
         with open(dic,'w',encoding='utf-8') as f:
             f.write(data)
             f.write(data)
+    kb = True
+    sb = True
+    def update_b():
+        if not kb:
+            b_list[1].config(state=tkinter.DISABLED)
+        if not sb:
+            b_list[0].config(state=tkinter.DISABLED)
     def Stop():
     def Stop():
-        nonlocal start
+        nonlocal start,kb,sb
         start = 0
         start = 0
-        b_list[0].config(state=tkinter.DISABLED)
+        sb = False
+        kb = False
+        update_b()
     def keep():
     def keep():
-        nonlocal start
+        nonlocal start,kb
         start = float('inf')
         start = float('inf')
-        b_list[1].config(state=tkinter.DISABLED)
+        kb = False
+        update_b()
 
 
     def pipe():pass
     def pipe():pass
     def not_out():
     def not_out():
@@ -472,6 +493,7 @@ def do_Sys(func,args,name='CoTan Git',break_time=2,show=True,text_n='',th=False,
     out_data = ''#包含out的data
     out_data = ''#包含out的data
     if show:
     if show:
         text, new_top, b_list = show_Now(Out_Txt,Stop,keep,not_out,pipe,name=name)#[close,keep]
         text, new_top, b_list = show_Now(Out_Txt,Stop,keep,not_out,pipe,name=name)#[close,keep]
+        update_b()
         if text_n != '':
         if text_n != '':
             text.insert('0.0',f'载入前提示>>> {text_n}\n')
             text.insert('0.0',f'载入前提示>>> {text_n}\n')
             out_data += f'载入前提示>>> {text_n}\n'
             out_data += f'载入前提示>>> {text_n}\n'
@@ -517,10 +539,12 @@ def do_Sys(func,args,name='CoTan Git',break_time=2,show=True,text_n='',th=False,
                 except:
                 except:
                     text, new_top, b_list = show_Now(Out_Txt, Stop, keep, not_out, pipe,
                     text, new_top, b_list = show_Now(Out_Txt, Stop, keep, not_out, pipe,
                                              name=f'{name} : 运行中')
                                              name=f'{name} : 运行中')
+                    update_b()
                     text.insert(tkinter.END, out_data)
                     text.insert(tkinter.END, out_data)
-                text.insert(tkinter.END, f'[out]> {i}\n')
-            data += i + '\n'
-            out_data += f'[out]> {i}\n'
+                if stop and i.replace(' ', '').replace('\n', '') != stopKey:
+                    text.insert(tkinter.END, f'[out]> {i}\n')
+                    data += i + '\n'
+                    out_data += f'[out]> {i}\n'
         if show:
         if show:
             text.insert(tkinter.END, '[END]')
             text.insert(tkinter.END, '[END]')
             out_data += f'[END]'
             out_data += f'[END]'
@@ -534,6 +558,7 @@ def do_Sys(func,args,name='CoTan Git',break_time=2,show=True,text_n='',th=False,
             except:
             except:
                 text, new_top, b_list = show_Now(Out_Txt, Stop, keep, not_out, pipe,
                 text, new_top, b_list = show_Now(Out_Txt, Stop, keep, not_out, pipe,
                                          name=f'{name} : 运行中')
                                          name=f'{name} : 运行中')
+                update_b()
                 text.insert(tkinter.END,out_data)
                 text.insert(tkinter.END,out_data)
             #界面刷新
             #界面刷新
             try:
             try:
@@ -545,11 +570,15 @@ def do_Sys(func,args,name='CoTan Git',break_time=2,show=True,text_n='',th=False,
             #输出字符
             #输出字符
             try:
             try:
                 i = p.stdout.readline()#.decode(str_code)#不需要decode,因为Popen已经设置了universal_newlines=True
                 i = p.stdout.readline()#.decode(str_code)#不需要decode,因为Popen已经设置了universal_newlines=True
-                if i.replace(' ','').replace('\n','') != '':
-                    if show:text.insert(tkinter.END,f'[out]> {i}')
-                    data += i
-                    out_data += f'[out]> {i}'
-                if p.returncode == 0 or (time.time() - start >= break_time and break_time != 0):
+                bool_text = i.replace(' ','').replace('\n','')
+                if bool_text != '':
+                    if stop and bool_text == stopKey:
+                        start = 0
+                    else:
+                        if show: text.insert(tkinter.END, f'[out]> {i}')
+                        data += i
+                        out_data += f'[out]> {i}'
+                if p.returncode == 0 or (time.time() - start >= break_time and break_time != 0) or (break_time == 0 and start == 0):
                     if show:
                     if show:
                         text.insert(tkinter.END,'[END]')
                         text.insert(tkinter.END,'[END]')
                         out_data += f'[END]'
                         out_data += f'[END]'
@@ -576,6 +605,15 @@ def do_Sys(func,args,name='CoTan Git',break_time=2,show=True,text_n='',th=False,
     except:pass
     except:pass
     return data
     return data
 
 
+def log():
+    global Git,log_Type
+    name = get_Name()
+    graph = bool(log_Type[0].get())
+    abbrev = bool(log_Type[1].get())
+    pretty = bool(log_Type[2].get())
+    do_Sys(Git.log,(name,graph,pretty,abbrev))
+    update_Git_Dir()
+
 def not_Args(func):
 def not_Args(func):
     global Git
     global Git
     name = get_Name()
     name = get_Name()
@@ -599,6 +637,13 @@ def Diff_File():
     do_Sys(Git.diff_File,(get_Name(),MASTER))
     do_Sys(Git.diff_File,(get_Name(),MASTER))
     update_Git_Dir()
     update_Git_Dir()
 
 
+def Reset_File():
+    global Git,Last_Name
+    dic = askopenfilenames(title=f'选择要撤销add的文件(取消为全选)')
+    if dic == '':dic = '.'
+    do_Sys(Git.reset_File,(get_Name(),dic))
+    update_Git_Dir()
+
 def Add_File():
 def Add_File():
     global Git,Last_Name
     global Git,Last_Name
     dic = askopenfilenames(title=f'选择要add的文件(取消为全选)')
     dic = askopenfilenames(title=f'选择要add的文件(取消为全选)')

+ 72 - 48
Git_Ctrl.py

@@ -3,9 +3,13 @@ from git import Repo
 from os.path import split,exists
 from os.path import split,exists
 import os
 import os
 import subprocess
 import subprocess
+from time import time
+import random
 
 
 sys_seeting = dict(shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,universal_newlines=True)
 sys_seeting = dict(shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,universal_newlines=True)
-git_path = 'git'
+git_path = 'git'# git的地址,如果配置了环境变量则不需要修改
+stopKey = '【操作完成】'#存储stopKey的global变量
+passwd = '1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM'#stopKey的候选词库
 
 
 class git_Repo:#git的基类
 class git_Repo:#git的基类
     def __init__(self,Dic,*args,**kwargs):
     def __init__(self,Dic,*args,**kwargs):
@@ -23,6 +27,14 @@ class git_Repo:#git的基类
         self.name = split(Dic)[-1]
         self.name = split(Dic)[-1]
         self.have_clone = True
         self.have_clone = True
 
 
+    def make_stopKey(self):#生成一个随机stopKey
+        global stopKey,passwd
+        code = ''
+        for _ in range(8):#八位随机数
+            code += passwd[random.randint(0, len(passwd) - 1)]#时间戳+8位随机数
+        stopKey = (str(time()) + code).replace('.','')
+        return stopKey
+
     def Flie_List(self,file_list,is_file=True,pat=' '):
     def Flie_List(self,file_list,is_file=True,pat=' '):
         if file_list == '.':
         if file_list == '.':
             file = '.'
             file = '.'
@@ -45,87 +57,99 @@ class git_Repo:#git的基类
 
 
     def Add_File(self,file_list):
     def Add_File(self,file_list):
         file = self.Flie_List(file_list)
         file = self.Flie_List(file_list)
-        return subprocess.Popen(f'{git_path} add {file}',cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 添加文件... && {git_path} add {file} && echo {self.make_stopKey()}',cwd=self.Repo_Dic,**sys_seeting)
+
+    def Reset_File(self,file_list):
+        file = self.Flie_List(file_list)
+        return subprocess.Popen(f'echo 撤销文件... && {git_path} reset {file} && echo {self.make_stopKey()}',cwd=self.Repo_Dic,**sys_seeting)
 
 
     def Commit_File(self,m):
     def Commit_File(self,m):
-        return subprocess.Popen(f'{git_path} commit -m "{m}"',cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 提交文件: && {git_path} commit -m "{m}" && echo {self.make_stopKey()}',cwd=self.Repo_Dic,**sys_seeting)
 
 
     def Status(self):#执行status
     def Status(self):#执行status
-        return subprocess.Popen(f'{git_path} status',cwd=self.Repo_Dic,**sys_seeting)
-
-    def Log(self):#执行log
-        return subprocess.Popen(f'{git_path} log',cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 仓库状态: && {git_path} status && echo {self.make_stopKey()}',cwd=self.Repo_Dic,**sys_seeting)
+
+    def Log(self,graph,pretty,abbrev):#执行log
+        args = ''
+        if graph:
+            args += ' --graph'
+        if pretty:
+            args += ' --pretty=oneline'
+        if abbrev:
+            args += ' --abbrev-commit'
+        return subprocess.Popen(f'echo 仓库日志: && {git_path} log{args} && echo {self.make_stopKey()}',cwd=self.Repo_Dic,**sys_seeting)
 
 
     def refLog(self):#执行reflog
     def refLog(self):#执行reflog
-        return subprocess.Popen(f'{git_path} reflog',cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 操作记录: && {git_path} reflog && echo {self.make_stopKey()}',cwd=self.Repo_Dic,**sys_seeting)
 
 
     def Diff_File(self,MASTER='HEAD'):#执行diff
     def Diff_File(self,MASTER='HEAD'):#执行diff
-        return subprocess.Popen(f'{git_path} diff {MASTER}',cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 文件日志: && {git_path} diff {MASTER} && echo {self.make_stopKey()}',cwd=self.Repo_Dic,**sys_seeting)
 
 
     def reset(self,HEAD='HEAD~1'):
     def reset(self,HEAD='HEAD~1'):
-        return subprocess.Popen(f'{git_path} reset --hard {HEAD}',cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 回退... && {git_path} reset --hard {HEAD} && echo {self.make_stopKey()}',cwd=self.Repo_Dic,**sys_seeting)
 
 
     def checkout(self,file_list):
     def checkout(self,file_list):
         if len(file_list) >= 1:#多于一个文件,不用--,空格
         if len(file_list) >= 1:#多于一个文件,不用--,空格
             file = self.Flie_List(file_list,pat=' ')
             file = self.Flie_List(file_list,pat=' ')
-            return subprocess.Popen(f'{git_path} checkout {file}',cwd=self.Repo_Dic,**sys_seeting)
+            return subprocess.Popen(f'echo 丢弃修改: && {git_path} checkout {file} && echo {self.make_stopKey()}',cwd=self.Repo_Dic,**sys_seeting)
         elif len(file_list) == 1:
         elif len(file_list) == 1:
-            return subprocess.Popen(f'{git_path} checkout -- {file_list[0]}', cwd=self.Repo_Dic, **sys_seeting)
+            return subprocess.Popen(f'echo 丢弃修改: && {git_path} checkout -- {file_list[0]} && echo {self.make_stopKey()}', cwd=self.Repo_Dic, **sys_seeting)
         else:
         else:
-            return subprocess.Popen(f'{git_path} checkout *', cwd=self.Repo_Dic, **sys_seeting)
+            return subprocess.Popen(f'echo 丢弃修改: && {git_path} checkout * && echo {self.make_stopKey()}', cwd=self.Repo_Dic, **sys_seeting)
 
 
     def rm(self,file_list):#删除版本库中的文件
     def rm(self,file_list):#删除版本库中的文件
         file = self.Flie_List(file_list)
         file = self.Flie_List(file_list)
-        return subprocess.Popen(f'{git_path} rm {file}', cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 删除... && {git_path} rm {file}', cwd=self.Repo_Dic,**sys_seeting)
 
 
     def check_Branch(self):#查看本地分支和远程分支
     def check_Branch(self):#查看本地分支和远程分支
-        return subprocess.Popen(f'echo 仓库分支:&&{git_path} branch -a&&echo 远程仓库信息:&&{git_path} remote -v',
+        return subprocess.Popen(f'echo 仓库分支: && {git_path} branch -a && echo 远程仓库信息: && {git_path} remote -v && '
+                                f'echo 分支详情: && {git_path} branch -vv && echo {self.make_stopKey()}',
                                 cwd=self.Repo_Dic,**sys_seeting)
                                 cwd=self.Repo_Dic,**sys_seeting)
 
 
     def new_Branch(self,branch_name, origin):#新建分支
     def new_Branch(self,branch_name, origin):#新建分支
-        return subprocess.Popen(f'{git_path} branch {branch_name} {origin}', cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 新建分支... && {git_path} branch {branch_name} {origin} && echo {self.make_stopKey()}', cwd=self.Repo_Dic,**sys_seeting)
 
 
     def switch_Branch(self,branch_name):#切换分支
     def switch_Branch(self,branch_name):#切换分支
-        return subprocess.Popen(f'{git_path} switch {branch_name}', cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 切换分支... && {git_path} switch {branch_name} && echo {self.make_stopKey()}', cwd=self.Repo_Dic,**sys_seeting)
 
 
     def del_Branch(self,branch_name,del_type):#删除分支
     def del_Branch(self,branch_name,del_type):#删除分支
-        return subprocess.Popen(f'{git_path} branch -{del_type} {branch_name}', cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 删除分支... && {git_path} branch -{del_type} {branch_name} && echo {self.make_stopKey()}', cwd=self.Repo_Dic,**sys_seeting)
 
 
     def merge_Branch(self,branch_name,no_ff,m=''):#合并分支
     def merge_Branch(self,branch_name,no_ff,m=''):#合并分支
         if no_ff:no_ff = f' --no-ff -m "{m}"'#--no-ff前有空格
         if no_ff:no_ff = f' --no-ff -m "{m}"'#--no-ff前有空格
         else:no_ff = ''
         else:no_ff = ''
-        return subprocess.Popen(f'{git_path} merge{no_ff} {branch_name}', cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 合并分支... && {git_path} merge{no_ff} {branch_name} && echo {self.make_stopKey()}', cwd=self.Repo_Dic,**sys_seeting)
 
 
     def merge_abort(self):#退出冲突处理
     def merge_abort(self):#退出冲突处理
-        return subprocess.Popen(f'{git_path} merge --abort', cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 冲突处理退出... && {git_path} merge --abort && echo {self.make_stopKey()}', cwd=self.Repo_Dic,**sys_seeting)
 
 
     def Save_stash(self):#保存工作区
     def Save_stash(self):#保存工作区
-        return subprocess.Popen(f'{git_path} stash', cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 保存工作区... && {git_path} stash && echo {self.make_stopKey()}', cwd=self.Repo_Dic,**sys_seeting)
 
 
-    def Stash_List(self):#保存工作区
-        return subprocess.Popen(f'{git_path} stash list', cwd=self.Repo_Dic,**sys_seeting)
+    def Stash_List(self):#工作区列表
+        return subprocess.Popen(f'echo 工作区列表: && {git_path} stash list && echo {self.make_stopKey()}', cwd=self.Repo_Dic,**sys_seeting)
 
 
-    def Apply_stash(self,stash_num = '0'):#保存工作区
-        return subprocess.Popen(f'{git_path} stash apply stash@{{{stash_num}}}', cwd=self.Repo_Dic,**sys_seeting)
+    def Apply_stash(self,stash_num = '0'):#恢复工作区
+        return subprocess.Popen(f'echo 恢复工作区... && {git_path} stash apply stash@{{{stash_num}}} && echo {self.make_stopKey()}', cwd=self.Repo_Dic,**sys_seeting)
 
 
-    def Drop_stash(self,stash_num = '0'):#保存工作区
-        return subprocess.Popen(f'{git_path} stash drop stash@{{{stash_num}}}', cwd=self.Repo_Dic,**sys_seeting)
+    def Drop_stash(self,stash_num = '0'):#删除工作区
+        return subprocess.Popen(f'echo 删除工作区... && {git_path} stash drop stash@{{{stash_num}}} && echo {self.make_stopKey()}', cwd=self.Repo_Dic,**sys_seeting)
 
 
-    def cherry_pick(self,commit):#保存工作区
-        return subprocess.Popen(f'{git_path} cherry-pick {commit}', cwd=self.Repo_Dic,**sys_seeting)
+    def cherry_pick(self,commit):#补丁
+        return subprocess.Popen(f'echo 补丁... && {git_path} cherry-pick {commit} && echo {self.make_stopKey()}', cwd=self.Repo_Dic,**sys_seeting)
 
 
     def Add_remote(self,remote,remote_name):
     def Add_remote(self,remote,remote_name):
-        return subprocess.Popen(f'{git_path} remote add {remote_name} {remote}', cwd=self.Repo_Dic, **sys_seeting)
+        return subprocess.Popen(f'echo 添加远程仓库... && {git_path} remote add {remote_name} {remote} && echo {self.make_stopKey()}', cwd=self.Repo_Dic, **sys_seeting)
 
 
     def Bind_remote(self,local_name,remote_name):
     def Bind_remote(self,local_name,remote_name):
-        return subprocess.Popen(f'{git_path} branch --set-upstream-to={remote_name} {local_name}', cwd=self.Repo_Dic,
+        return subprocess.Popen(f'echo 分支绑定... && {git_path} branch --set-upstream-to={remote_name} {local_name} && echo {self.make_stopKey()}', cwd=self.Repo_Dic,
                                 **sys_seeting)
                                 **sys_seeting)
 
 
     def push_Tag(self,tag,remote_name):
     def push_Tag(self,tag,remote_name):
-        return subprocess.Popen(f'{git_path} push {remote_name} {tag}', cwd=self.Repo_Dic, **sys_seeting)
+        return subprocess.Popen(f'echo 推送标签... && {git_path} push {remote_name} {tag} && echo {self.make_stopKey()}', cwd=self.Repo_Dic, **sys_seeting)
 
 
     def del_tag(self,tag):
     def del_tag(self,tag):
-        return subprocess.Popen(f'{git_path} tag -d {tag}', cwd=self.Repo_Dic, **sys_seeting)
+        return subprocess.Popen(f'echo 删除本地标签... && {git_path} tag -d {tag} && echo {self.make_stopKey()}', cwd=self.Repo_Dic, **sys_seeting)
 
 
     def Add_Tag(self,tag,commit,message=''):
     def Add_Tag(self,tag,commit,message=''):
         a = ' -a'
         a = ' -a'
@@ -135,16 +159,16 @@ class git_Repo:#git的基类
             a = ''
             a = ''
         if commit != '':
         if commit != '':
             commit = f' {commit}'#自带空格
             commit = f' {commit}'#自带空格
-        return subprocess.Popen(f'{git_path} tag{a} {tag}{commit}{message}', cwd=self.Repo_Dic,
+        return subprocess.Popen(f'echo 添加标签... && {git_path} tag{a} {tag}{commit}{message} && echo {self.make_stopKey()}', cwd=self.Repo_Dic,
                                 **sys_seeting)
                                 **sys_seeting)
 
 
     def Tag(self,condition=''):
     def Tag(self,condition=''):
         if condition != '':
         if condition != '':
             condition = f' -l {condition}'
             condition = f' -l {condition}'
-        return subprocess.Popen(f'{git_path} tag{condition}', cwd=self.Repo_Dic,**sys_seeting)
+        return subprocess.Popen(f'echo 标签列表: && {git_path} tag{condition} && echo {self.make_stopKey()}', cwd=self.Repo_Dic,**sys_seeting)
 
 
     def show_new(self,condition):
     def show_new(self,condition):
-        return subprocess.Popen(f'{git_path} show {condition}', cwd=self.Repo_Dic, **sys_seeting)
+        return subprocess.Popen(f'echo 查询结果: && {git_path} show {condition} && echo {self.make_stopKey()}', cwd=self.Repo_Dic, **sys_seeting)
 
 
     def Pull_Push_remote(self,Pull_Push=0,remote='',remote_branch='',local='',allow=False,u=False):
     def Pull_Push_remote(self,Pull_Push=0,remote='',remote_branch='',local='',allow=False,u=False):
         #处理逻辑
         #处理逻辑
@@ -180,8 +204,7 @@ class git_Repo:#git的基类
         else:
         else:
             history = ''
             history = ''
         push_pull = {0:"pull",1:f"push{' -u' if u else ''}"}
         push_pull = {0:"pull",1:f"push{' -u' if u else ''}"}
-        print(f'''{git_path} {push_pull.get(Pull_Push,"pull")}{history} {remote_name} {branch}''')
-        return subprocess.Popen(f'''{git_path} {push_pull.get(Pull_Push,"pull")}{history} {remote_name} {branch}''',
+        return subprocess.Popen(f'''echo 与服务器连接... && {git_path} {push_pull.get(Pull_Push,"pull")}{history} {remote_name} {branch} && echo {self.make_stopKey()}''',
                                 cwd=self.Repo_Dic, **sys_seeting)
                                 cwd=self.Repo_Dic, **sys_seeting)
 
 
     def del_Branch_remote(self,remote,remote_branch):
     def del_Branch_remote(self,remote,remote_branch):
@@ -194,10 +217,10 @@ class git_Repo:#git的基类
         if len(branch_split) >= 2 and remote_name == '':
         if len(branch_split) >= 2 and remote_name == '':
             remote_name = branch_split[0]  # 2)
             remote_name = branch_split[0]  # 2)
             remote_branch = '/'.join(branch_split[1:])  # 2)
             remote_branch = '/'.join(branch_split[1:])  # 2)
-        return subprocess.Popen(f'{git_path} push {remote_name} :{remote_branch}',cwd=self.Repo_Dic, **sys_seeting)
+        return subprocess.Popen(f'echo 删除远程分支... && {git_path} push {remote_name} :{remote_branch} && echo {self.make_stopKey()}',cwd=self.Repo_Dic, **sys_seeting)
 
 
     def del_Tag_remote(self,remote,tag):
     def del_Tag_remote(self,remote,tag):
-        return subprocess.Popen(f'{git_path} push {remote} :refs/tags/{tag}',cwd=self.Repo_Dic, **sys_seeting)
+        return subprocess.Popen(f'echo 删除远程标签... && {git_path} push {remote} :refs/tags/{tag} && echo {self.make_stopKey()}',cwd=self.Repo_Dic, **sys_seeting)
 
 
     def fetch(self,remote,remote_branch,local):
     def fetch(self,remote,remote_branch,local):
         # 处理逻辑
         # 处理逻辑
@@ -225,13 +248,13 @@ class git_Repo:#git的基类
             else:
             else:
                 branch = f'{remote_branch}'
                 branch = f'{remote_branch}'
 
 
-        return subprocess.Popen(f'''{git_path} fetch {remote_name} {branch}''', cwd=self.Repo_Dic, **sys_seeting)
+        return subprocess.Popen(f'''echo 更新远程仓库... && {git_path} fetch {remote_name} {branch} && echo {self.make_stopKey()}''', cwd=self.Repo_Dic, **sys_seeting)
 
 
     def Customize(self,command:str):
     def Customize(self,command:str):
         return subprocess.Popen(command,cwd=self.Repo_Dic, **sys_seeting)
         return subprocess.Popen(command,cwd=self.Repo_Dic, **sys_seeting)
 
 
     def Clone(self,url):
     def Clone(self,url):
-        return subprocess.Popen(f'echo 无法克隆', cwd=self.Repo_Dic, **sys_seeting)
+        return subprocess.Popen(f'echo 克隆操作不被允许', cwd=self.Repo_Dic, **sys_seeting)
 
 
 class Clone_git(git_Repo):#Clone一个git
 class Clone_git(git_Repo):#Clone一个git
     def __init__(self, Dic, *args, **kwargs):
     def __init__(self, Dic, *args, **kwargs):
@@ -243,10 +266,9 @@ class Clone_git(git_Repo):#Clone一个git
     def Clone(self,url):
     def Clone(self,url):
         if self.have_clone:super(Clone_git, self).Clone(url)
         if self.have_clone:super(Clone_git, self).Clone(url)
         self.have_clone = True
         self.have_clone = True
-        return subprocess.Popen(f'{git_path} clone {url} {self.Repo_Dic}', cwd=split(self.Repo_Dic)[0], **sys_seeting)
+        return subprocess.Popen(f'echo 正在克隆... && {git_path} clone {url} {self.Repo_Dic}', cwd=split(self.Repo_Dic)[0], **sys_seeting)
 
 
     def after_Clone(self):
     def after_Clone(self):
-        print('F')
         self.repo = Repo(self.Repo_Dic)
         self.repo = Repo(self.Repo_Dic)
 
 
 class git_Ctrol:
 class git_Ctrol:
@@ -278,11 +300,14 @@ class git_Ctrol:
     def add_File(self,name,dic_list):
     def add_File(self,name,dic_list):
         return self.get_git(name).Add_File(dic_list)
         return self.get_git(name).Add_File(dic_list)
 
 
+    def reset_File(self,name,dic_list):
+        return self.get_git(name).Reset_File(dic_list)
+
     def commit_File(self,name,m):
     def commit_File(self,name,m):
         return self.get_git(name).Commit_File(m)
         return self.get_git(name).Commit_File(m)
 
 
-    def log(self,name):
-        return self.get_git(name).Log()
+    def log(self,name,graph,pretty,abbrev):
+        return self.get_git(name).Log(graph,pretty,abbrev)
 
 
     def reflog(self,name):
     def reflog(self,name):
         return self.get_git(name).refLog()
         return self.get_git(name).refLog()
@@ -385,5 +410,4 @@ class git_Ctrol:
         try:
         try:
             return self.get_git(name).after_Clone()
             return self.get_git(name).after_Clone()
         except:
         except:
-            # return None
-            raise
+            return None