git

How to update custom package version?

How to update custom package version? Question: I am trying to create a python package that I can reuse in other projects. I did follow this tutorial: Create Your Custom, private Python Package That You Can PIP Install From Your Git Repository. It works but when I update the code of my package and then …

Total answers: 1

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

Problem with split a cmd string in python

Problem with split a cmd string in python Question: The cmd.split() does not work: cmd = f’git log –all –grep="fixed bug" –pretty="%H|%an"’ process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) Generate this error: With this code instead it works. cmd = f’git log –reverse –pretty=format:"%H|%an|%at"’ It is not a problem of "bugs" because leaving only "fixed" does not …

Total answers: 1

how to split the repository history one line for each commit?

how to split the repository history one line for each commit? Question: I’m trying to have the history of a repository, but the result is returned to me on a single line of text. The command I’m using: cmd = f’git log –all –grep="fixed bug"’ The result I would like to have: commit 337f4f4e798ea675cd57348212857ce051e857ffAuthor: Vinod… …

Total answers: 1

Github Workflow / Action commit to repository returning 403

Github Workflow / Action commit to repository returning 403 Question: I have a Github Workflow file where I bump the version of the python package (setup.py) and afterwards I want to push the changes to the repository the workflow runs in. But I get 403 no access granted back build-package: permissions: contents: read id-token: write …

Total answers: 1

Getting the latest git commit id from URL on internal git using Python

Getting the latest git commit id from URL on internal git using Python Question: With the following function I am extracting the latest git commit id in a short form and write it into a text file. from os.path import exists from subprocess import Popen, PIPE def get_git_commit_id(txt_file: str) -> str: """ Gets the latest …

Total answers: 2

How to split up git log output into a list of commits in python?

How to split up git log output into a list of commits in python? Question: Given git log output like such: commit 19e0f017ac832238f5a800dd3ea7a5966b3c1343 (HEAD -> master, origin/master, origin/HEAD) Author: Slim Shady Date: Sun Sep 18 19:53:42 2022 -0700 ci: remove debugging line github action script commit body commit ef82c672d21d70c43f0454b0b4d6fa22ef4ad0a9 (fix_release_action) Author: Slim Shady Date: Sun …

Total answers: 2

What is the purpose of saved* command in a .gitignore file?

What is the purpose of saved* command in a .gitignore file? Question: Following the .gitignore file in one of my research project built in python I have noticed the saved* command but I couldn’t relate the purpose of it from that project directory. Here’re the commands in the .gitignore file: *.pyc .ipynb_checkpoints saved* Now, I …

Total answers: 1