So bin ich das Problem immer gitpython mit:Keine Handler für Logger "git.remote" gefunden werden konnte
No handlers could be found for logger "git.remote"
Mein Code
print repo_object.remote() # origin
print repo_object.active_branch # master
print repo_object.active_branch.name # master
refspec = repo_object.active_branch.name + ":refs/for/" + repo_object.active_branch.name
print refspeC# master:/refs/for/master
print "Push " + refspeC# push master:refs/for/master
print remote.push(refspec) # [<git.remote.PushInfo object at 0x....>]
remote.push(refspec)
pushed_repos.append(repo_name)
print pushed_repos # my project repo
Mein Ziel ist es, ein Modul neu hinzugefügt zu schieben (erstellt/aktualisiert) Dateien zu Gerrit.
Edit: Anfrage von @Arount
Ok, so habe ich eine Funktion
genanntdel_proj_gerrit(pushed_repos, commit_message, repo_path, repo_name, push)
Die Argumente hat folgende Werte:
pushed_repos # []
commit_message # just a commit message
repo_name_path # path to my local repo
repo_name # name of the project repo
push # A value of True is set here
Inside my del_proj_gerrit
Funktion Ich habe:
add_all_files("./")
if push == True:
commit_and_push(pushed_repos, commit_message, repo_path, repo_name)
Ich
Inside my commit_and_push
Funktion haben:
repo_path_new = repo_path+repo_name
repo_object = Repo(repo_path_new) # <git.Repo "C\localpath\.git\modules\repo-project">
if commit_command_line(commit_message, repo_object, repo_name):
# Inside the if-statement you have the code I posted before
Innerhalb der commit_command_line
Funktion Ich habe:
cmd = "git commit -m \"%s\"" % commit_message
errmsg = "Failed command:\n" + cmd
success = True
try:
execute_shell_process(cmd, errmsg, True, True)
except CommonProcessError as e:
print "Error during commit for repo '" + repo_name + "' (ret code " + \
str(e.returncode) + ")."
print "Assuming that there was no changes to last commit => continue"
success = False
return success
@Arount – user535081
meine bearbeiten Überprüfen Sie, bevor Sie die Funktion Zurückverfolgungs Verwenden Sie niemals wirklich. Sollen Sie 'traceback.print_exc() 'vorschlagen? denn wenn ich das tue, bekomme ich keine. Aus der Dokumentation, die ich gelesen habe, scheint es, als müsste ich 'try & except' verwenden. Die Sache ist, ich bekomme die ** Push-Master: Refs/für/Master Keine Handler gefunden werden konnte für Logger "git.remote" **, wenn ich versuche, es scheint wie drücken. Mit anderen Worten, ich bekomme keine Fehler :(. Die Funktion, die ich oben eingefügt habe, ist die richtige (möglicherweise nicht das beste Format). – user535081
@Arount 'Keine Handler konnten für den Logger gefunden werden ...' ist eine Warnung, kein Fehler – phd