From 29c8427bf1fc1daf25d7eda9507593ea312bb44b Mon Sep 17 00:00:00 2001 From: kenil-shah Date: Thu, 1 Oct 2020 12:41:10 -0400 Subject: [PATCH 001/114] Added Plan Of Action File --- Plan_Of_Action.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Plan_Of_Action.md diff --git a/Plan_Of_Action.md b/Plan_Of_Action.md new file mode 100644 index 0000000..813014d --- /dev/null +++ b/Plan_Of_Action.md @@ -0,0 +1,13 @@ +# Group 5 takeover plan. + +## Contributing Policy updates: + +## Testing updates: + +## Organizational Updates: + +## Coding tasks: + +### List of Actions Based on Priority + +### Current Plan of Work [Task Allocations]: From 31b9bd51c0f7d3e166abb76cfb5bcf82e11eae6f Mon Sep 17 00:00:00 2001 From: Kenil Shah Date: Thu, 1 Oct 2020 13:05:29 -0400 Subject: [PATCH 002/114] Update Plan_Of_Action.md --- Plan_Of_Action.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plan_Of_Action.md b/Plan_Of_Action.md index 813014d..a0f6c39 100644 --- a/Plan_Of_Action.md +++ b/Plan_Of_Action.md @@ -1,4 +1,4 @@ -# Group 5 takeover plan. +# Group 6 takeover plan. ## Contributing Policy updates: From efa6b761d8fe07e3d58687dde7153cef126e0322 Mon Sep 17 00:00:00 2001 From: urvishvasani <54722077+urvishvasani@users.noreply.github.com> Date: Sat, 3 Oct 2020 11:27:56 -0400 Subject: [PATCH 003/114] Create tasks.md --- tasks.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tasks.md diff --git a/tasks.md b/tasks.md new file mode 100644 index 0000000..5d7b26c --- /dev/null +++ b/tasks.md @@ -0,0 +1,8 @@ +## Things already done: +abc + +## Things need to be done: +abc + +## Deliverables for phase 2: +abc From 371d4d0e05fcfaf1e19c2d690ed99a2e29b997e4 Mon Sep 17 00:00:00 2001 From: urvishvasani Date: Sat, 3 Oct 2020 12:29:24 -0400 Subject: [PATCH 004/114] edited tasks.md file\ --- tasks.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/tasks.md b/tasks.md index 5d7b26c..b84eb97 100644 --- a/tasks.md +++ b/tasks.md @@ -1,8 +1,31 @@ ## Things already done: -abc +1. Supported functionalities + - gits pr_update + - gits profile + - gits rebase + - gits reset + - gits set + - gits upstream + - gits super reset + - gits add + - gits commit + - gits create_branch + - gits logging +2. Currently, this project can only be executed in Linux operating system. ## Things need to be done: -abc +1. Transform this 'what' documentation to 'how' documentation. +2. Write instructions to setup an environment to run this project. +3. Add Unit tests for every GITS command. +4. Refactor the code using a suitable pattern if possible. +5. Split the implementation into src and tst directories. +6. Implement functional tests for this new command line tool. +7. Add new simplified commands in addition to what is already implemented. +8. Add unit test coverage checker before Gits Push. +9. Make this tool available for windows operating system as well. ## Deliverables for phase 2: -abc +1. Well defined automated testing setup. +2. Mixture of What and How documentation. +3. Implementation of new additional functionalities. + From 4eea552ade8c43991228d8f3c723075ce9bac7a8 Mon Sep 17 00:00:00 2001 From: Harshit Patel Date: Sat, 3 Oct 2020 22:30:25 -0400 Subject: [PATCH 005/114] updated tasks.md --- tasks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.md b/tasks.md index b84eb97..8581a27 100644 --- a/tasks.md +++ b/tasks.md @@ -11,7 +11,7 @@ - gits commit - gits create_branch - gits logging -2. Currently, this project can only be executed in Linux operating system. +2. Currently, this project can only be executed on Linux or Mac operating system's. ## Things need to be done: 1. Transform this 'what' documentation to 'how' documentation. From d586aec9836fa39bdc76946d3bc42d37a957708f Mon Sep 17 00:00:00 2001 From: Kenil Shah Date: Tue, 6 Oct 2020 04:16:34 -0400 Subject: [PATCH 006/114] Delete Plan_Of_Action.md --- Plan_Of_Action.md | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 Plan_Of_Action.md diff --git a/Plan_Of_Action.md b/Plan_Of_Action.md deleted file mode 100644 index a0f6c39..0000000 --- a/Plan_Of_Action.md +++ /dev/null @@ -1,13 +0,0 @@ -# Group 6 takeover plan. - -## Contributing Policy updates: - -## Testing updates: - -## Organizational Updates: - -## Coding tasks: - -### List of Actions Based on Priority - -### Current Plan of Work [Task Allocations]: From 90aed0f1b209d5c0c4dce388fbeabd94167046c3 Mon Sep 17 00:00:00 2001 From: urvishvasani <54722077+urvishvasani@users.noreply.github.com> Date: Tue, 6 Oct 2020 08:19:40 -0400 Subject: [PATCH 007/114] Update tasks.md --- tasks.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tasks.md b/tasks.md index 8581a27..ddc3452 100644 --- a/tasks.md +++ b/tasks.md @@ -23,6 +23,18 @@ 7. Add new simplified commands in addition to what is already implemented. 8. Add unit test coverage checker before Gits Push. 9. Make this tool available for windows operating system as well. +10. New functionalities: + - gits push + - gits sync + - gits init + - gits status + - gits track + - gits untrack + - gits diff + - gits checkout + - gits branch + + ## Deliverables for phase 2: 1. Well defined automated testing setup. From e92d5ee917d66f5123f4c73178fb161abf291994 Mon Sep 17 00:00:00 2001 From: harshitpatel96 Date: Sat, 17 Oct 2020 18:53:55 -0400 Subject: [PATCH 008/114] added configuration file for fish terminal --- GITS.egg-info/PKG-INFO | 15 +++++++++++++++ GITS.egg-info/SOURCES.txt | 7 +++++++ GITS.egg-info/dependency_links.txt | 1 + GITS.egg-info/requires.txt | 1 + GITS.egg-info/top_level.txt | 1 + configurations/project_init.fish | 24 ++++++++++++++++++++++++ dist/GITS-0.1-py3.8.egg | Bin 0 -> 1097 bytes 7 files changed, 49 insertions(+) create mode 100644 GITS.egg-info/PKG-INFO create mode 100644 GITS.egg-info/SOURCES.txt create mode 100644 GITS.egg-info/dependency_links.txt create mode 100644 GITS.egg-info/requires.txt create mode 100644 GITS.egg-info/top_level.txt create mode 100644 configurations/project_init.fish create mode 100644 dist/GITS-0.1-py3.8.egg diff --git a/GITS.egg-info/PKG-INFO b/GITS.egg-info/PKG-INFO new file mode 100644 index 0000000..f6c4412 --- /dev/null +++ b/GITS.egg-info/PKG-INFO @@ -0,0 +1,15 @@ +Metadata-Version: 1.1 +Name: GITS +Version: 0.1 +Summary: GITS project +Home-page: UNKNOWN +Author: CSC510 - Group 17 +Author-email: tagrawa3@ncsu.edu +License: MIT +Description: UNKNOWN +Platform: UNKNOWN +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python +Classifier: Development Status :: 3 - Alpha +Classifier: Intended Audience :: Developers +Classifier: Topic :: GITS Project diff --git a/GITS.egg-info/SOURCES.txt b/GITS.egg-info/SOURCES.txt new file mode 100644 index 0000000..ba35f46 --- /dev/null +++ b/GITS.egg-info/SOURCES.txt @@ -0,0 +1,7 @@ +README.md +setup.py +GITS.egg-info/PKG-INFO +GITS.egg-info/SOURCES.txt +GITS.egg-info/dependency_links.txt +GITS.egg-info/requires.txt +GITS.egg-info/top_level.txt \ No newline at end of file diff --git a/GITS.egg-info/dependency_links.txt b/GITS.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/GITS.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/GITS.egg-info/requires.txt b/GITS.egg-info/requires.txt new file mode 100644 index 0000000..e079f8a --- /dev/null +++ b/GITS.egg-info/requires.txt @@ -0,0 +1 @@ +pytest diff --git a/GITS.egg-info/top_level.txt b/GITS.egg-info/top_level.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/GITS.egg-info/top_level.txt @@ -0,0 +1 @@ + diff --git a/configurations/project_init.fish b/configurations/project_init.fish new file mode 100644 index 0000000..89e9453 --- /dev/null +++ b/configurations/project_init.fish @@ -0,0 +1,24 @@ +set SCRIPT_DIR (cd (dirname (status -f)); and pwd) + +set PROJECT_DIR $SCRIPT_DIR/.. + +set RELATIVE_GITS_PATH "code/gits.py" + +set GITS_EXEC_PATH "$PROJECT_DIR/$RELATIVE_GITS_PATH" + +set FISHRC ~/.config/fish/conf.d/virtualfish-loader.fish + +if [ -f "$FISHRC" ]; + echo "$FISHRC exists, appending gits commandline tool alias" + echo "alias gits=\"python3 $GITS_EXEC_PATH\"" >> $FISHRC +else + echo "$FISHRC does not exist, creating a new file and adding gits commandline tool alias" + echo "alias gits=\"python3 $GITS_EXEC_PATH\"" >> $FISHRC +end + +echo "Intializing gits directory in user home directory" + +set GITS ~/.gits +set GITS_LOG ~/.gits/logs + +mkdir -p $GITS $GITS_LOG diff --git a/dist/GITS-0.1-py3.8.egg b/dist/GITS-0.1-py3.8.egg new file mode 100644 index 0000000000000000000000000000000000000000..8e855d34ea95d46b9550fdb144cfb8b96c9b92b5 GIT binary patch literal 1097 zcmWIWW@Zs#U|`^2kj)7UoZ;6Z^B2gQ%gDeW2&7%z-E}?v-2C+eydjLxfZJKk4g$6J z*UykQaB)Bq-{IIzfGF7|9zHkcYkqSahjjVhT{!4*)8>ZpH0Xw z3R|qi*S;$Iru;tN3hAj%<^Pu+u=?z(v>|-4#%2qZ)75{&=G$k79VsyFbG|vv|EHLd zg@v&0lk?n@CpuXcaadUVId->O%r0+5{~Ha~%=wG_LXUrY(mL7f46EGDvmFnU=KOL$ zCAfFGxM$|$N9^Yw-U$o1apjZSUz6oW*!ONSIk!a2%hUFN;8%gmnv?hKT)wJG_3q_f zw`9?m47mpc{;J$r%G`Z1u5jtv5{0|Vue!cb%`{BcV|=+%J2!oeh_Jo=wn(|(%mFB2 z#gO!4K>{eOfEW~l@URN@4-Im54c05EDB&(DE%{h_^|bFpEk9jN-3!_)o)mrO;k@SU z>wo?18Sm5A`9G9h|N5o)v%4_gH-6rtGTv+2D>WP^dwS}6ob~oR>%Fe${K+$?^^PrC zqOo;@$z~1F*&&{Fjx~N+ky(5md<>{An#^|Hh#BY-VB|5#BD*LhwIDSwB{eU(GCn6W zFS{7zw8uODl)i)^zPvfh&Xg7}=& zveX=`Rw8RdNp4k{1-iwFX{lgGGBSxU<4&SL+rVH+BZz`W0xZD>c%y1Zk2Q#928Jb# zI>2CqYe$MhbQ6#r4GLu#Skkx;*#vB1j&2lskRy!xgKQLX1fUy%>>5zW!@!b83nnE0 mpu__{GeFS*14|n7k0|NkZw>_Q! literal 0 HcmV?d00001 From 9c63b008cdb8ab482689522ed0af78f00eb3b56b Mon Sep 17 00:00:00 2001 From: kenil-shah Date: Mon, 19 Oct 2020 14:19:48 -0400 Subject: [PATCH 009/114] Gits reset working now --- .idea/.gitignore | 3 +++ .idea/GITS.iml | 12 ++++++++++++ .idea/inspectionProfiles/Project_Default.xml | 18 ++++++++++++++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ code/gits_rebase.py | 5 ++++- code/gits_reset.py | 6 ++++-- code/gits_super_reset.py | 10 ---------- 10 files changed, 65 insertions(+), 13 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/GITS.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/GITS.iml b/.idea/GITS.iml new file mode 100644 index 0000000..8b8c395 --- /dev/null +++ b/.idea/GITS.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..77e53ac --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,18 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..65531ca --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..1164086 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/code/gits_rebase.py b/code/gits_rebase.py index eb68843..acbc621 100644 --- a/code/gits_rebase.py +++ b/code/gits_rebase.py @@ -3,7 +3,10 @@ def gits_rebase(args): - """This is a highly simplified version of git rebase command. This interactive command asks for the branch that you want to rebase and automatically rebases it off master. This is the most common scenario. The original GIT rebase command is a little un-intuitive and there is always a confusion , about the source branch and the destination branch. + """This is a highly simplified version of git rebase command. + This interactive command asks for the branch that you want to rebase and automatically rebases it off master. + This is the most common scenario. The original GIT rebase command is a little un-intuitive and there is always a + confusion , about the source branch and the destination branch. """ print(args) print("Hello from GITS command line tools- Rebase") diff --git a/code/gits_reset.py b/code/gits_reset.py index 735f40f..cf18717 100644 --- a/code/gits_reset.py +++ b/code/gits_reset.py @@ -3,13 +3,15 @@ def gits_reset(args): - """'Reset' intuitively means a HARD reset. This functionality does a HARD reset on your branch, and makes it even with the remote branch. This aims to simplify the confusion between HARD and the SOFT reset.""" + """'Reset' intuitively means a HARD reset. + This functionality does a HARD reset on your branch, and makes it even with the remote branch. + This aims to simplify the confusion between HARD and the SOFT reset.""" print("Hello from GITS command line tools- GITS reset") try: process1 = subprocess.Popen(['git', 'checkout', args.branch], stdout=PIPE, stderr=PIPE) stdout, stderr = process1.communicate() # print(stdout) - process2 = subprocess.Popen(['git', 'reset', '--hard', 'origin', args.branch], stdout=PIPE, stderr=PIPE) + process2 = subprocess.Popen(['git', 'reset', '--hard', args.branch], stdout=PIPE, stderr=PIPE) stdout, stderr = process2.communicate() # print(stdout) except Exception as e: diff --git a/code/gits_super_reset.py b/code/gits_super_reset.py index 0bdc4b5..57c8b77 100644 --- a/code/gits_super_reset.py +++ b/code/gits_super_reset.py @@ -18,11 +18,7 @@ def super_reset(args): print("Required parameters are not provided. " "Please add --name parameter.") return False - - # Stepping into the repository for configuration details os.chdir("./" + args.name) - - # get remote url first remote_loc = check_output(["git", "config", "remote.origin.url"]) if not remote_loc: @@ -30,15 +26,9 @@ def super_reset(args): return False remote_loc = remote_loc.strip().decode("utf-8") - - # going out of the directory to remove it os.chdir("../") - - # removing the repo print("Removing the current repository...") shutil.rmtree(args.name) - - # new clone print("Freshly cloning...") check_output(["git", "clone", remote_loc]) From 74b5cd5938f1d9ef58a35b24fb1430b8d95ae7d9 Mon Sep 17 00:00:00 2001 From: kenil-shah Date: Mon, 19 Oct 2020 14:21:10 -0400 Subject: [PATCH 010/114] Fixing directory --- .idea/.gitignore | 3 --- .idea/GITS.iml | 12 ------------ .idea/inspectionProfiles/Project_Default.xml | 18 ------------------ .idea/inspectionProfiles/profiles_settings.xml | 6 ------ .idea/misc.xml | 4 ---- .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ 7 files changed, 57 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/GITS.iml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/GITS.iml b/.idea/GITS.iml deleted file mode 100644 index 8b8c395..0000000 --- a/.idea/GITS.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 77e53ac..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 65531ca..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 1164086..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 38442740c429678fcda51ff9dee66bc3d119a7e3 Mon Sep 17 00:00:00 2001 From: kenil-shah Date: Mon, 19 Oct 2020 15:44:51 -0400 Subject: [PATCH 011/114] Added gits delete functionlity --- .idea/workspace.xml | 45 +++++++++++++++++++++++++++++++++++++++++++++ code/gits.py | 6 ++++++ code/gits_delete.py | 23 +++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 .idea/workspace.xml create mode 100644 code/gits_delete.py diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..b10215a --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1603129738929 + + + + \ No newline at end of file diff --git a/code/gits.py b/code/gits.py index 0ca034e..321abb6 100755 --- a/code/gits.py +++ b/code/gits.py @@ -13,6 +13,7 @@ from gits_rebase import gits_rebase from gits_reset import gits_reset +from gits_delete import gits_delete from gits_profile import gits_set_profile from gits_pr_update import gits_pr_update_func @@ -88,6 +89,11 @@ gits_reset_subparser.set_defaults(func=gits_reset) gits_reset_subparser.add_argument('--branch', required=True, help='branch to be used') +gits_reset_subparser = subparsers.add_parser('delete', help='sync help') +gits_reset_subparser.set_defaults(func=gits_delete) +gits_reset_subparser.add_argument('--branch', required=True, help='branch to be used') +gits_reset_subparser.add_argument('--count', required=True, help='Last commits to be deleted') + args = parser.parse_args() args.func(args) diff --git a/code/gits_delete.py b/code/gits_delete.py new file mode 100644 index 0000000..4b6b7a8 --- /dev/null +++ b/code/gits_delete.py @@ -0,0 +1,23 @@ +import subprocess +from subprocess import PIPE + + +def gits_delete(args): + """This function will delete a commit from the remote branch. + This functionality is useful when you have commited a mistake to the remote repo and do not + want it be visible in your commit history. + """ + print("Hello from GITS command line tools- GITS reset") + try: + process1 = subprocess.Popen(['git', 'checkout', args.branch], stdout=PIPE, stderr=PIPE) + stdout, stderr = process1.communicate() + process2 = subprocess.Popen(['git', 'reset', '--hard', "HEAD~"+str(args.count)], stdout=PIPE, stderr=PIPE) + stdout, stderr = process2.communicate() + process3 = subprocess.Popen(['git', 'push', '--force'], stdout=PIPE, stderr=PIPE) + stdout, stderr = process3.communicate() + print('Last '+args.count+' commits have been deleted') + except Exception as e: + print("ERROR: gits reset command caught an exception") + print("ERROR: {}".format(str(e))) + return False + return True From 5560c30aeb8bae19e2dc06efa9a8b9ae9fa516bb Mon Sep 17 00:00:00 2001 From: kenil-shah Date: Mon, 19 Oct 2020 15:47:45 -0400 Subject: [PATCH 012/114] Gits delete readme --- .idea/workspace.xml | 2 +- code/gits_delete.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b10215a..cb55dcc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,7 @@ - +