commit

How to fetch an orphaned commit?

How to fetch an orphaned commit? Question: tl;dr: I have a repository cloned but cannot see an orphaned commit locally. How can I get that commit if it did not come with the repo? Details: I am trying to get the contents of a specific file on a specific commit using gitpython as below (using …

Total answers: 1

sqlalchemy session with autocommit=True does not commit

sqlalchemy session with autocommit=True does not commit Question: I’m trying to use a session with autocommit=true to create a row in a table, and it does not seem to be working. The row is not saved to the table. import os import sqlalchemy from sqlalchemy import Table from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker …

Total answers: 1

What is the use case for Django's on_commit?

What is the use case for Django's on_commit? Question: Reading this documentation https://docs.djangoproject.com/en/4.0/topics/db/transactions/#django.db.transaction.on_commit This is the use case for on_commit with transaction.atomic(): # Outer atomic, start a new transaction transaction.on_commit(foo) # Do things… with transaction.atomic(): # Inner atomic block, create a savepoint transaction.on_commit(bar) # Do more things… # foo() and then bar() will be called …

Total answers: 2

Get tags of a commit

Get tags of a commit Question: Given an object of GitPython Commit, how can I get the tags related to this commit? I’d enjoy having something like: next(repo.iter_commits()).tags Asked By: Uko || Source Answers: The problem is that tags point to commits, not the other way around. To get this information would require a linear …

Total answers: 2