View Issue Details

IDProjectCategoryView StatusLast Update
0003897gaugerclientpublic2016-05-06 18:13
ReporterfournierAssigned ToBart Polot 
PrioritynormalSeverityfeatureReproducibilityalways
Status assignedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0003897: Gauger Improved Git detection
DescriptionAt this time the Gauger client only detects a git repository by looking for the .git directory. This means it cannot detect a git repository if it is in a subdirectory.
Git repository detection could be done by looking at the return value of any well formrd git command.
Steps To ReproduceRun Gauger from a sudirectory of a git repository.

Gauger does not recognize it as a valid Git repository.
Additional InformationThe file uploaded is a patch implementing what I described as a possible solution. Feel free to use it or not.
TagsNo tags attached.

Activities

fournier

2015-07-17 14:39

developer  

git_detect.diff (736 bytes)
Index: gauger
===================================================================
--- gauger	(révision 36094)
+++ gauger	(copie de travail)
@@ -64,6 +64,12 @@
     (stdout, stderr) = p.communicate()
     return int(stdout)
 
+def is_git():
+    ret = os.system ("git status")
+    if 0 == ret:
+        return True
+    return False
+
 def hgversion():
     p = subprocess.Popen("hg id -n", shell=True,
       stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -128,7 +134,7 @@
     revision = args.id
 elif(os.path.exists('.svn') or is_svn()):
     revision = svnversion()
-elif(os.path.exists('.git')):
+elif(os.path.exists('.git') or is_svn()):
     revision = gitversion()
 elif(os.path.exists('.hg')):
     revision = hgversion()
git_detect.diff (736 bytes)

fournier

2015-07-20 14:14

developer  

git_detect_fixed.diff (748 bytes)
Index: gauger
===================================================================
--- gauger	(révision 36094)
+++ gauger	(copie de travail)
@@ -64,6 +64,12 @@
     (stdout, stderr) = p.communicate()
     return int(stdout)
 
+def is_git():
+    ret = os.system ("git status > /dev/null")
+    if 0 == ret:
+        return True
+    return False
+
 def hgversion():
     p = subprocess.Popen("hg id -n", shell=True,
       stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -128,7 +134,7 @@
     revision = args.id
 elif(os.path.exists('.svn') or is_svn()):
     revision = svnversion()
-elif(os.path.exists('.git')):
+elif(os.path.exists('.git') or is_git()):
     revision = gitversion()
 elif(os.path.exists('.hg')):
     revision = hgversion()
git_detect_fixed.diff (748 bytes)

fournier

2015-07-20 14:15

developer   ~0009471

New version of the patch, fixed a typo and silenced the git call

Christian Grothoff

2016-05-06 18:13

manager   ~0010656

Bart, could you please review the patch and possibly integrate it?

Issue History

Date Modified Username Field Change
2015-07-17 14:39 fournier New Issue
2015-07-17 14:39 fournier File Added: git_detect.diff
2015-07-20 14:14 fournier File Added: git_detect_fixed.diff
2015-07-20 14:15 fournier Note Added: 0009471
2015-08-08 12:11 Christian Grothoff Assigned To => fournier
2015-08-08 12:11 Christian Grothoff Status new => assigned
2016-05-06 18:13 Christian Grothoff Assigned To fournier => Bart Polot
2016-05-06 18:13 Christian Grothoff Note Added: 0010656