#help-with-git

1 messages ยท Page 1 of 1 (latest)

brazen crag
#

OK. I am here to ask a GIT question. I have recently read through the "always work on a branch" page. Now hesitant since I may have used a sequence that screws up the preferred or normal workflow. So here is my sequence: Used github via browser to fork from CircuitPython (7/22/22). Cloned to my local repo on my VBox-Ubuntu using command line. Edited files, compiled successfully. Discovered issues. Went back to browser created a branch called 'toyfib'. Now I need the steps to push my changes to branch 'toyfib' for review. My fears: I'll hose one or more of the repos, remote or local. If I need to perform things in a different sequence, I can copy the 7 'new' files off and then perform things as needed. I'll acquire the understanding more by doing...

fierce field
brazen crag
#

I did steps 1 & 2 last week. Then added feature dir and files. I assume its safe to continue with 3,4 & 5 now. Yell if not, otherwise going forward...Thanks!

brazen crag
#

latkinso42@MST-Ubuntu64:~/research/circuitpython$ git commit -a -m "First commit of toy module Fibonacci"
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('python', '-mpip', 'install', '.')

ruby loom
#

do you have python?

brazen crag
#

I tried making paths 'long' but it did not help

ruby loom
#

and python-pip

brazen crag
#

perhaps it upset because i have python3 / pip3

ruby loom
#

nope, that's the right one

brazen crag
#

on Ubuntu

ruby loom
#

but you may now also need python-is-python3

brazen crag
#

??

ruby loom
#

it makes a shortcut for python to point straight to python3

#

that's not always present

#

the command it's having trouble with is python

brazen crag
#

ah yes.. an alias, right?

ruby loom
#

so if you can type that at the command line and it opens up a python terminal, then the next problem is no pip

brazen crag
#

but perhaps more

ruby loom
#

should be good to go with python-is-python3 tho

brazen crag
#

its not found. tried to install it too ... not found

#

(sigh)

ruby loom
#

oofsies. what happens if you type python -v

brazen crag
#

it complains... python3 opens interpreter

#

Its whatever the latest Ubuntu has by defualt

ruby loom
#

how about this, sudo update-alternatives --install /usr/local/bin/python python /usr/bin/python3

#

sorry, one of my ubuntus has the python-is-python3 package available and the other doesn't, i am not sure why that happens

brazen crag
#

trying...

ruby loom
#

basically what's happening is there's a script that says "hey, before you let that commit run, let's run this script first" and that script needs python -mpip install . to work in order to get the files it needs to proceed

brazen crag
#

does it need a <priority> ?

ruby loom
#

oh yeah, sorry

#

my memory of that command is failing me

brazen crag
#

<priority> == ?

ruby loom
#

50 is the one i usually do

#

but it's any number you like as far as i know

brazen crag
#

ok.. that part worked

#

so now..

ruby loom
#

can you type python -v and see python 3.something now?

#

oops. capital V. man, i'm rusty

#

V for Version

#

v for verbose

#

all to just get a pre-commit hook to work, oofsies

brazen crag
#

its hung

#

oh.. there is a >>> prompt

ruby loom
#

yep, good to go now, try your commit again

brazen crag
#

Python 3.10.4

ruby loom
#

oo that's a couple versions newer than mine. is this ubuntu 22.04?

brazen crag
#

now its complaining about an unhealthy python environment

#

Assertion Error

ruby loom
#

oh no NotLikeThis

#

what's unhealthy about it?

#

i've not heard of that, so it must be a part of the checks that that project does before allowing a commit

brazen crag
#

Need to put Discord on my VBox. Copy and paste not working, even though I turned it on

#

hard to copy issues..

#

latkinso42@MST-Ubuntu64:~/research/circuitpython$ git commit -a -m "First commit of toy module Fibonacci"
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('python', '-mpip', 'install', '.')

ruby loom
#

oh yeah, mine does that to me all the time

#

it's super frustrating

onyx night
#

That should be python -m pip

#

Not mpip

brazen crag
#

that works fine

#

what is happening here... python is not aliased correctly, or what?

onyx night
#

No the prehook is buggery

#

It's trying to run -mpip when it should be running -m pip

ruby loom
#

it should still work with or without the space

#
fury@FATMAN:~$ python -mpip --version
pip 21.3.1 from /home/fury/.local/lib/python3.8/site-packages/pip (python 3.8)
brazen crag
#

can I repair this?

onyx night
#

H u h ok

#

Anyway try running that command locally

ruby loom
#

yep, try python -mpip install .

#

with the dot too

onyx night
#

Oh you'd need to be in the right folder

#

Don't know what the right folder is- should be visible in the prehook definition

ruby loom
#

usually a setup.py or something like that in the current folder

#

setup.py or pyproject.toml

brazen crag
#

o.. tried 'python -mpip --version'

#

it worked fine

ruby loom
#

now python -mpip install .

#

see if it's failing for some other reason that it won't say when it tries from the commit

#

and give me a moment to clone the original repo and play along here

brazen crag
#

should i be in my home dir?

ruby loom
#

i don't think so

#

what i'm not entirely sure of is if this commit hook is trying to install something for circuitpython or if it's trying to set up the pre-commit hook script itself

#

cloning the submodules now

#

yeesh there's a lotta submodules

onyx night
#

A multitude!

ruby loom
#

guess cuz circuitpython supports a lotta devices!

onyx night
#

I would assume the pre commit is for something like black but I haven't looked

ruby loom
#

check submitted code for problems before it gets to GitHub, according to the build circuitpython page

brazen crag
#

i did this:

#

Install pip if it is not already installed (Linux only)

sudo apt install python3-pip

Install needed Python packages from pypi.org.

pip3 install --upgrade -r requirements-dev.txt
pip3 install --upgrade -r requirements-doc.txt

#

and this

#

cd <your repository clone directory>

You only need to do this once in each clone.

pre-commit install

#

over a week ago

ruby loom
#

ok

brazen crag
#

...... Stuck

ruby loom
#

weird

#

ok, here is my log starting from after the submodules finished cloning. the commit worked for me. that's strange

#

see if i did anything different

brazen crag
#

there are several setup.py files in multiple folders of circuitpython

ruby loom
#

i did have to manually install pre-commit though, it didn't come with the requirements-dev.txt like i assume it should've

#

(maybe this is cause for me to contribute!)

brazen crag
#

oh.. we are now in a pending dependency queue.

#

Should I copy my files and rebuild my environment?

ruby loom
#

maybe, i'm not sure what might've happened and that's a good way to be sure. you can see which files you need to grab by typing git status to see what's staged for commit, if you didn't already

#

cloning into a new directory and starting the modifications over again may fix whatever went wrong in the pre-commit environment

#

but i am not familiar with that tool

onyx night
#

Did you install pre-commit to begin with

ruby loom
#

apparently you can type pre-commit run at any time in any circuitpython directory to try it

#

there's some output lee pasted that suggests pre-commit is present and capable of running

#

OH

#

i think i may have an idea

#

do you have multiple terminal windows open by any chance?

brazen crag
#

yes

ruby loom
#

are you doing this in the same window where you set up update-alternatives

brazen crag
#

ah.. i think i know where you are going

#

cant remember

ruby loom
#

close and reopen the window, should be good to go

#

whatever its path is, it's not aware of the python shortcut

#

so restarting it may fix that

#

but i thought /usr/local/bin/ was always in the path

#

or

#

if this is an ubuntu virtual machine, may have to restart the desktop session

fierce field
#

@brazen crag are you on 22.04? 22.04 and Python 3.10.x is fine for circuitpython development. That's what I'm using

#

no reason to use a special python environment

brazen crag
#

still have assertion error

#

So thats what I thouhgt I put on VBox, It was the latest iso from ubuntu 64 bit

#

yet when I do uname -a

#

it says 5.15.0-14 generic

#

ok..lsb_release -a indicates Jammy 22.04

#

SO YES!

#

i guess uname -a is now passe'

fierce field
#

cat /etc/issue is what I usually do

brazen crag
#

Yes its 22.04

#

ther is an Assertion Error on line 86 of pre-commit/repository.py

#

not sure what I did or missed to lead to this..

#

Python is 3.10.4

onyx night
#

What's the assertion error being displayed

fierce field
#

what is pre-commit --version ?

#

I have 2.17.0

brazen crag
#

An unexpected error has occurred: AssertionError: BUG: expected environment for python to be healthy() immediately after install, please open an issue describing your environment
Check the log at /home/latkinso42/.cache/pre-commit/pre-commit.log

#

yes 2.17.0

#

I could squirrel my files off the VBox and restart my entire build environment, but that may take several hours

fierce field
#

let's figure out how to clean up pre-commit and reinstall it

brazen crag
#

(Whew) Thanks

fierce field
#

try pre-commit uninstall and then pre-commit install. did you try that already?

brazen crag
#

doing that now

#

ok...try the commit now?

fierce field
#

do pre-commit run to try it before the commit to see if it's still messed up

brazen crag
#

Assertion Erro still there

fierce field
#

so I'm confused, did you mess with the python installation earlier? there was some mention of update-alternatives

brazen crag
#

Originally it was "An unexpected error has occurred: CalledProcessError: command: ('python', '-mpip', 'install', '.')

#

fury tried to help and so did Vax

fierce field
#

I have never seen that either, it's confusing you would see that

#

try pre-commit clean, and then pre-commit run again

#

pre-commit puts stuff in ~/.cache/pre-commit. It looks like uninstall/install does not clean that out

brazen crag
#

Assertion Error

fierce field
#

which python

brazen crag
#

let me look

fierce field
#

pre-commit clean does clean that out

brazen crag
#

Python 3.10.4

#

yes it removes the log file completely

fierce field
#

what is dpkg -l python3 is it 3.10.4-0ubuntu2

brazen crag
#

Yes

fierce field
#

have you updated ubuntu recently?

brazen crag
#

I just got the ISO a week ago. havent looked for an update

fierce field
#

other people are having this problem, hold on for a solution

brazen crag
#

is this a PPA issue?

fierce field
#

ok try this:

pip3 install --upgrade virtualenv
rm -rf ~/.local/share/virtualenv
#

it's claimed to be an issue with the python package on 22.04.

#

after the above uninstall and install and clean pre-commit again

brazen crag
#

ok.. done

#

try with a run?

fierce field
#

yes

#

i am confused why i am not seeing this problem

brazen crag
#

Assertion Error

#

its a complex environment. You might be doing things uncontiously that I don't think about everyday. I try to be stepwise methodical.. nbut...

#

I followed gthe older sample 42 pages and preceeding instruction

#

You indicated they had not been updated in a while

fierce field
#

yes but, I wrote the instructions ๐Ÿ™‚ and our environments appear to match, so there's some difference. I also don't understand this particular failure. I'll do some more reserach. In the meantime, just pre-commit uninstall and forget about it for a bit

#

I need to figure out the cause because you will not be the only sufferer

brazen crag
#

thanks Dan.. I need to eat .. blood sugar is low..

#

later

fierce field
#

@brazen crag I remember some recent python updates (within the past week), so try sudo apt update; sudo apt full-upgrade

brazen crag
#

Doing that now...will take a bit...

#

ok. Done. Should I try 'pre-commit run' ?

#

(sigh) Assertion Error

#

this env is cursed.

thorn star
#

adabot is spicy and angry still, even after reverting the linting change

#

I figured out how to test that section of the code, so I'll patch it today

fierce field
brazen crag
#

Understood!

#

I appreciate all the help. I'll start the reinstall process and document every step..

#

Thanks Again. Cheers.

thorn star
#

Actually, I think the integration test might have some useful info for confirming it's unbotched, so will be nice to let the CI finish and read that.

brazen crag
#

@fierce field looking at the the pre-commit issues most referenced the issue tracker, rather a circular chase. So, looked at the owners most recent updates and figured (guessed) he solved it by going to Python3.11. Most Linux releases can be a step version behind.

#

Several steps and I added the Alternatives mapping for both python and python3

#

then reboot for safe measures ( even though shouldnt have to)

#

pre-commit runs fine!

#

Yeah!

fierce field
brazen crag
#

So many things to use; so few days. Hopefully i can get the commit to the branch when my head clears to tackle the real issue of no module found. Later...

safe crystal
#

anyone else on firefox getting this when trying to attach something to a github discussion? guessing it's a browser bug of somekind. just recently (last days) started.

brazen crag
#

git push
fatal: The current branch toyfib has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin toyfib
#

What is origin?

dusk jungle
#

That would be the remote repository that you originally cloned your local copy from, typically.

small hemlock
#

Yeah, when you initially clone you can set the name, but origin is the default and will probably work as-is

brazen crag
#

SO, the main branch of circuitpython.

safe crystal
#

repo, not branch

#

git remote -v

brazen crag
#

Got it ...! Thanks! For me some things I learn merely by reading (conceptual). Others (perhaps git) I will learn by frequency of use. Thanks for your help and patience.

small hemlock
#

Yeah, it's really a local label for a remote repository. You can in theory have multiple, and the people who make git use it that way. For your average developer who just uses something like github as their repository of truth, you only have one remote, and the default name of origin works just fine

#

When you make a branch locally and then want to push it out, they want you to confirm which remote you want to push to, since pushing to the wrong one could be a big deal. I do wish there was some way to say I only have one no need to confirm

safe crystal
#

are you planning on making any pull requests to circuitpython?

still iron
#

@safe crystal I have FF and no problems. I drag and drop files into the comment window and don't use the attach buttons though. Don't know if you're using drag and drop.

safe crystal
brazen crag
#

Being a Git Newbee: I performed a push of my local repo to a branch of my circuitpython fork. However, my changes are not showing up. So many hoops, hurdles and hills... lost in procedure....Any suggestions as to how to check or resolve the missing directories & files?

#

Do I use 'git add <file>' or 'git add <newdir/newfile>' to fix?

gritty mural
#

Usually you can do like git add -u to add untracked files

#

Or git add -A

safe crystal
#

a quick run of git status can be helpful as well

#

can use that to check current branch and sanity check what git thinks has changed vs. what you think has changed

#

i typically use git add . followed by git commit -m (insert comment), but there numerous ways of doing the same thing

#

there's a fair amount of semantics fork, clone, commit, push, pull request etc.

#

it can def be confusing at first

small hemlock
#

Also, sanity check: you said you pushed to a branch. If you're looking at github, it'll show you the master/main branch by default. You may have to change what branch you're looking at to see your changes.

#

Pardon if that's too newbish, but you did say you were new.

brazen crag
#

Yes, well its been a long time and I never used it much, so near the same thing. I appreciate all the halp.. reading now (first) then will try next. Thanks Again!

safe crystal
#

that graphic doesn't show branching though

brazen crag
#

I seemed to have performed a commit and push to a branch. I verified. Thanks for everyone's help! Cheers,

brazen crag
#

Ok, I have my code and build to a 'good' state. I would like to update everything (remote and local, main and toyfib branch). Whats the bes sequence, so I dont hose anything or stomp on my own added module?

queen mango
#

But git is generally pretty good at not letting you shoot yourself in the foot

sturdy talon
# brazen crag Ok, I have my code and build to a 'good' state. I would like to update everythin...

I think they're beyond cloning. They want to update branches and forks. The issue is, if not done properly, you can end up in a rebase. As I'm unclear on exactly what's been updated where, I hesitate to suggest anything. The short version is git pull remote-name branch-name, and it fetches and merges all of the updates. But like I said, there might be a particular order you want to do it in, all depends on what has been updated with what. I want someone with a bit more experience, or at least more familiarity with your situation to assist.

queen mango
#

Ahhh I see

#

Oh yeah I meant to say git pull

brazen crag
#

I cloned (forked to my remote) and copied to my local about 10 days ago. After adding a new module, I then added a branch (I know the goof here). I continued writing my module after checking out the branch on my local. So, first my local & remote main needs to be reconciled with THE MAIN. Second, my branch (local & remote) needs the same (without blowing away my added module.

sturdy talon
#

OK, so you might end up having to do a rebase to reconcile mains. Depends on what was committed while you were still on main locally.

brazen crag
#

No intention of pushing to the main adafruit circuitpython repository for this toy module...

#

i see

sturdy talon
#

Right, I know. It wouldn't let you anyway.

#

Send me a link to your fork. I can at least tell you where to start.

brazen crag
sturdy talon
#

Uff. Your fork started 105 commits behind adafruit:main. You will almost certainly have to rebase to get up to current with Adafruit. I am of no help whatsoever with rebasing, I usually end up starting over entirely when I end up with one. So let me ask you a question. How many files have you changed with this module you're writing? e.g. How far spread are your changes.

brazen crag
#

One module 'fibonacci'; 4 in common-hal/fibonacci; 3 in shared-bindings; two other in py.

#

I think I know where you are going

#

save off the files and start over fresh

sturdy talon
#

Yeah..... Well, not quite.

#

In this case, you don't need to reclone entirely.

#

You can save out your files, then go back to latkinso42:main, and do a git pull adafruit main followed by git push latkinso42 main to get up to date.

#

Then create a new branch and add your changes back.

#

This should work.

#

Otherwise you can update main, but your branch will be 105 commits behind, which could indeed require a rebase. There are obviously tons of folks who are comfortable rebasing, it's a skill worth having, but I still haven't gotten to that point.

small hemlock
#

The process I would normally do: update your main to match adafruit main. There shouldn't be any conflicts because you didn't make changes ot main. Then try to merge main into your branch (the direction is important). This likely will make conflicts, resolve those here. When the conflicts are resolved, your branch should be guaranteed to merge cleanly back into main

brazen crag
#

I have before under other repositories (not git) but never that many files...

sturdy talon
brazen crag
#

I may have inadvertent changes to main on my loca I do not want to push

sturdy talon
#

Ergo, hacky workaround. ๐Ÿ˜•

#

Hmm.

#

@small hemlock Do you have a bit to help? You sound like you're far better equipped to assist.

#

(I seriously need to get more comfortable with rebasing.)

small hemlock
#

Most of the time, conflicts with a GUI are pretty easy. You're basically just looking at two bits of code and choosing which one to keep in most cases. If it's a thing you meant to change, you usually pick your code. Otherwise, pick the upstream code.

#

Maybe familiarity with the code itself would help a lot, and I don't even know much about circuit python. I could try though. At least for a bit until my work meeting.

brazen crag
#

right. if its my module in main i only wanted in a branch then...?

small hemlock
#

The first thing to realize is that there's nothing magic about rebasing, it's just a merge that looks a bit different. Some places prefer rebasing, some actually ban rebasing ๐Ÿ˜‰

sturdy talon
brazen crag
#

Ill start by copiing out my files and performing a pull against my main

small hemlock
#

Copying out your files shouldn't hurt anything, but if they're safely committed on your branch it also shouldn't be necessary

brazen crag
#

After putting my main back to rights, I'll come back the the branch. Worst case I kill the branch and re-branch and add seven files back

small hemlock
#

I looked at your changes in main on your repo and at least what's been pushed to github I don't see your name on main

#

Your main seems to be clean, just behind

brazen crag
#

ok.. great.

#

be back in a bit.. thanks

night reef
#

rebasing is basically replaying the commits on a new starting commit. The commit hashes then change. A merge creates a single new commit that merges changes together and doesn't change the existing commits

#

rebasing is nice to produce linear history but changing commit hashes can cause loss of info (if for example, the old commit was already reviewed.)

small hemlock
#

Yeah, both of them end up with a logical merge between two branches.

#

The way they do it is different and people have Strong Opinions about which way is right ๐Ÿ˜‰

brazen crag
#

ok my remote main is in sync with Adafruit Main. The I performed a 'git pull -p' in my local which sync my local with my remote main. However , it mentions changes not staged for commit. It should be clean. whats step to clean any stray references to old unintetional code changes.

waxen hill
#

Just show git status and see what it says. Pretty sure it gives remedial information.

#

git diff should show modifications as well.

brazen crag
#

git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: frozen/circuitpython-stage (new commits)
modified: ports/espressif/esp-idf (new commits)
modified: shared-bindings/pulseio/PulseIn.c

#

things left over from bad file edits on main.

waxen hill
#

I generally never do work in branch main.

#

git checkout -b mybranch

#

do the work there.

brazen crag
#

yes. however my local main was hosed. trying to bring back to vanilla normal.

waxen hill
#

There is a way to apply a single diff and do it all in one go.

#

Really depends if you like the files the way they are right now as to how to check them into the database, for inclusion.

#

I make a recursive copy and work on the copy, and commit often.

#

If you're working with other people you can mask that by occasionally copying your finished work over their exisitng work, take a diff and see if it looks like a respectable commit or not.

brazen crag
#

I know git is powerful and useful for working with lots of code and with others. However, 'reseting' or starting over 'fresh' on one's own system should be as simple as 'start_over'. I see no reason for extraneus complication.. its just time consumming

#

So back to the status reference of "changes not staged for commit"... I should not have any

cloud hound
#

git reset --hard

#

or git reset --hard HEAD~10 and then git pull

#

note that both with completely destroy all your changes

#

the second one will also destroy your last 10 commits

brazen crag
#

still showing 'Changes not staged for commit'

cloud hound
#

in your repo, or in submodules?

brazen crag
#

in my local repo, main branch

cloud hound
#

reset --hard should delete those

#

git can also git checkout individual files

brazen crag
#

it shows up to date with main repo, but indicates 'Chnages not staged...'

#

at this point it would be easier, at least conceptually, to blow away my local. I have nothing to save that isn't stowed away (7 files). Then I could start again. So far, trying to correct my local main has not proven easy or do-able.

#

i have tried 'git restore <file>', 'git clean', 'git reset --hard'

cloud hound
#

what does git status say?

brazen crag
#

same as above at 4:37pm today (look above)

brazen crag
#

I appreciate everyone's help! It seems Alexander had the correct solution to the Gordian Knot. Obliterate it and go on with more productive things. Ok, maybe he was impatient, un-scholastic and perhaps narcistic. But all I needed was a fresh starting point with no code or outstanding changes. ... I know I need to learn how to untie GIT KNOTS, but perhaps over time. Right now its time to move forward with my project. Time trying to solve git issue today= 3+ hours; time to start fresh with new repo <= 45 min. THANKS AGAIN -- Everyone!

small hemlock
#

I did nuke-it-from-orbit a lot in the beginning. I can see myself doing so again if I'm under enough time pressure. But it is helpful to eventually figure out how things work and how to diagnose what went wrong

waxen hill
#

I make a recursive copy and work on the copy. If it doesn't function there's no love lost; just recursively erase it and try again.

#

If it doesn't say fast forward there's only a small number of circumstances where that's acceptable.

#

small commits help a lot in making sure no work gets lost due to git fumbles.

#

I make a test branch ('git checkout -b newbranch') and try a merge on the test branch.

#

If that succeeds, I merge to the one it came from.

#
 $ git checkout dvlp
 $ git checkout -b test-dvlp
 $ git merge otherwork

 $ git checkout dvlp
 $ git merge otherwork
 $ git branch -D test-dvlp
#

The test-dvlp branch creation allows me to not have to recursively copy the entire repository just to test a merge (to make sure it'll go fast forward instead of any other merge strategy).

#

I keep a local remote repository in addition to the github remote, and update both frequently.

#
 $  git remote -v
localorigin     /some/path/to/altair/altair_88x_asl-apps-b-rmt.d/.git (fetch)
localorigin     /some/path/to/altair/altair_88x_asl-apps-b-rmt.d/.git (push)
origin  git@github.com:wa1tnr/altair_88x_asl-apps-b.git (fetch)
origin  git@github.com:wa1tnr/altair_88x_asl-apps-b.git (push)
brazen crag
#

well i tried to switch my back to main and inadvertently created Main on my local. I guess I could ignore it, but really afraid to remove it.

brazen crag
#

resolved...!

#

git branch -a

#

git branch -D Main

near oyster
#

maybe a git gui like Sourcetree would help with the git commands

brazen crag
#

My local main indicates two commits ahead of origin/main. I do not recall adding anything and want my local main to be a pure reflection of my remote fork of circuitpython main 'now'. Can I see what these commits are and remove them?

eager violet
#

Should show you the last two commits

brazen crag
#

got it ... thanks

#

they were innocuous.

small hemlock
#

You can also git diff between two references, but the syntax for that is something I always have to look up, then I have to reason about which is + and which is -

#

but that works if your new commits aren't the most recent two

eager violet
#

The -p shows a diff

small hemlock
#

I mean I diff between two references not limited to any specific amount of commits or anything

#

the equivalent of checking out both references to two different directories and diffing the directories

full steeple
#

I'm cloning a repo onto my machine using GitHub Desktop and it's stuck at Resolving Deltas: 100% (11/11), done. What can I do here?

fierce field
full steeple
#

I'll try that thanks

brazen crag
#

Somehow my local main is three commits ahead of origin/main. Not sure how to reconcile or backout these commits.

upper dawn
brazen crag
#

Thanks. The three commit are most likely innocuous and unwanted. but good procedure.

molten haven
#

After updating my CP fork via the sync fork button, my forked repo on GH is lacking lots of recent tags. I remember having this problem before but can't recall how I fixed it.

cloud hound
#

git pull --tags the-original-repo main and then git push --tags

#

replace the-original-repo with the url of the original repo, of course

molten haven
#

That (like many things in git) seems roundabout

vital lava
#

probably ancient design choices involving not tracking tags separately per-remote, so they're not pulled by default, because they might conflict with tags you've created locally

cloud hound
small hemlock
#

Yeah, git was designed for a many-remotes situation that the original architects used a lot

#

The majority of git users don't use it that way, and don't really understand the edge cases that supporting that way requires

molten haven
#

OK, back to a sane build environment now, now I can get onto working on board bringup

brazen crag
#

In my local main, it appears I have an un-staged path or directory (not a file). I have tried to reset and restore, but no luck.

thorn star
#

You could try clean, but I talso depends if it's a submodule I think. What exactly needs to be undone?

brazen crag
#

a long list of file in frozen/

#

I tried git clean... did not work

fierce field
brazen crag
#

Modified: frozen/Adafruit_Circuitpython_<filename> lots of times

#

I'm on a virtualBox .. doesnt always copy well

#

All unstaged

fierce field
#

do make fetch-submodules at the top level, or run this alias:

alias gitsubupdate='git submodule sync --quiet --recursive && git submodule update --init'
#

it's because the frozen librries were updated, probly

brazen crag
#

Like Magic (my hat is off, have a great evening)

thorn star
#

Submodules are tricky, glad it's sorted!

brazen crag
#

On GitHub, my main is up-to-date, my branch will not sync with main without loosing 31 updates. How do I rconcile?

brazen crag
#

Issues on Github

thorn star
#

You could use git stash or merge the changes

#

@brazen crag When in doubt, I like to pull in main and do a merge commit.

#

You can manually tweak where the conflict is then

#

You could also rebase it, but I do that more for small changes, but those far better at it than I might say differently haha

brazen crag
#

SO I should resolve on local? I normally just perform a sync on GitHub, but it says it should delete the last 31 changes...SO the solution is resolution at the local level?

#

that is..non web?

thorn star
#

Yeah, sometimes GitHub forces you to do it locally.

#

Definitely commit all your changes to get a point you can rewind to in the worst case.

#

Then you can do git pull upstream main (assuming your trying to sync from the upstream)

#

Then you'll have to resolve any conflicts

brazen crag
#

I just re-did my vbox and Ubuntu build env. Just cloned my fork of the circuitpython repo and did a checkout of my adcdma branch. No changes.

#

issue is between main and adcdma branches

#

so resolve locally , then push upsteam

#

correct?

thorn star
#

Are you trying to pull changes from your main or from Adafruit's main?

brazen crag
#

My main

thorn star
#

Oh, the no need to do it upstream. But yeah, resolve locally with git pull origin main, resolve conflicts, then git push origin main

waxen hill
#

I make a recursive copy of the local repository, elsewhere on the hard disk, and only pull from the remote on gitub (and not push back to it).

#

If I can't come up with a fast forward I'll just copy the current state of any files and then do 'git checkout -- filename.ext' to reset the file to what git knows it to be (removes changes made since that file's contents were in a commit).

#

By making many small commits, I usually avoid suprises. I always make a copy of the merge target ('git checkout -b target-copied') and do a test merge.

The fact that when I do the merge itself (on the original merge target branch) .. its the exact same shred (hex string unique to a merge/commit) that says a lot about how it is deterministic.

full steeple
#

False alarm, 'twas a typo

brazen crag
#

At one time I had my git using GCM so that performing a PUSH was smooth. Now I have to go thru many gymnastics to get everything to work. Is there a better way?

still lantern
#

Do folks here find that they use the command line interface or a GUI for source control more in their day jobs?

I teach a few engineering workshops and I have students learn the command line interface. Iโ€™m currently developing an Android app development workshop and the student helping me says his industry contacts use the interface within Android Studio for source control, not the terminal. Another friend of mine that interned at Garmin said everyone used the terminal. Two other friends that work at Google and a video game design company say they always use a GUI. They also think learning the terminal is a bit unnecessary saying, โ€œโ€ฆteaching the concept of source control is more important than the specific method/tool.โ€ I personally use the command line. I was curious what experiences people here have.

manic fiber
#

My AP (college-level in high school) Computer Science instructor has us use GitHub Desktop (https://desktop.github.com), and I personally find myself using whatever's nearest for simple things (like git commit -m "Add colors"; git push) but a GUI for more complex things

thorn star
#

I use a combination. I think it depends on both what's easier and what specifically.

#

My file explorer has a terminal in it and if I just want to add all my changes and commit, using the CLI is fastest. But sometimes I'm making a lot of changes and want to commit only specific lines or something like that. At that point, I'm usually in VS Code and just use the builtin git stuff there.

#

So basically the same as @manic fiber

north swift
#

I use IntelliJ Idea for work and 99% of the time I'm using the integrated interface in it. Personal projects I use command line. In previous jobs I've used command line and something like Git Kraken.

I do feel like I really "learned" git when using it with some UI interface like Git Kraken or SourceTree. The command line was too abstract for me at the time. Being able to see the branching, commits, and merging helped tremendously.

waxen hill
#

I think I get a lot out of both systems. Command line essential to get work done, but there are 'high fences' to situational awareness to adapt to.

#

I use gitk for sanity checks, as it's the first GUI tool I encountered that works with git.

#

I have a nice cli-based recipe to copy files with their edit histories I use on the command line pretty often. It seems to do what I want it to do. Over time I've memorized most of it and almost feel like I understand what it does (a stackexchange code lift ;)

plush horizon
#

CLI๏ฟฝ-only. I've dabbled with GUIs over the years, but there's always something advanced they can't do, like a fixup commit in an interactive rebase, or using the reflog to recover a lost commit. I haven't worked at a company yet (web dev) where GUI clients were standard. those products seem to come and go, too.

plush horizon
thorn star
#

Yeah, I'll have to play around with it. Most of the time if I need that level of interactivity I'm probably already in VS Code which is nice. I think the only time I'm ever adding something from the terminal is something like a KiCAD file where I'd never commit anything other than it all, so it ends up working out in the end.

#

I'm also not big on things like nano or vim but I can see the utility of having that there if you are ๐Ÿ™‚

plush horizon
#

ah, VS Code can be your git editor, too!
git config --global core.editor "code --wait"

smoky isle
#

Weird, my git question from earlier got silently deleted

sturdy talon
#

I assume it was the strings of multiple dashes.

#

If you like, I can repost it for you, or send you the content via DM and you can try editing it to try to post it again yourself.

full steeple
manic fiber
manic fiber
#

There's a .deb in that release

full steeple
#

Sorry I'm a noob I don't know what that means

full steeple
#

I guess I'll have to learn to use the CLI

#

Because I got the latest to install and it "works" except it doesn't sign me in to my account

#

weird that github doesn't have a linux install

full steeple
#

when setting up a git.config file should user.name be my actual name or my github username if I want to use this with github?

cloud hound
#

it can be anything

#

github doesn't care

vital lava
#

it will be used to format your commit messages. typically your "full name" goes there, and your email address goes in user.email. GitHub matches on email addresses

full steeple
#

How much of that is public?

vital lava
#

all of it, if you push to a public repository

#

note that Git will try to synthesize some defaults if you don't set those config variables, and you may or may not like the result

cloud hound
#

you can have multiple e-mail addresses configured in github, I recommend having a special address just for the commits

full steeple
#

I have never remembered to change properly and I can't figure out how to get it to warn me

#

And I'm on Linux for this project so I'm CLI

cloud hound
#

warn about what?

full steeple
#

Ask me rather

#

Whether I'm using the email I want to use

cloud hound
#

I usually just edit ~/.git/config

full steeple
#

But you have to remember to do that right

cloud hound
#

you can also have .git/config in the repository, with different address if you want

#

if you want to use different names or addresses for different projects

#

this is not a github thing, by the way, it's just git

vital lava
#

you can use something like git config --global user.email foo@example.com and it'll set it in the global config

full steeple
#

So on a github public commit, what function does .name have?

full steeple
vital lava
cloud hound
#

it's just saved in the commit, as part of the commit data

full steeple
#

CLI

cloud hound
#

it's purely informational

cloud hound
#

it's so that other people can easily tell who made the commit

safe cloud
#

you can configure your public commit email in git git config user.email "email@example.com"

full steeple
#

This looks promising

cloud hound
#

that's not entirely true, it's not possible technically to enforce this

#

as long as you control any domain, you can just setup an alias domain for mailinator or any similar service

#

they can't possibly blacklist them all

full steeple
#

I meant the second half

thorn star
#

Also it might have been said and I just missed it, but you can also use a GitHub generated email that is linked to your account as well, i recently changed mine to this so it shows as me (as in my GitHub account) making commits.

vital lava
# full steeple I meant the second half

sure, you could set the noreply email address as your default commit email address, if you don't mind a GitHub address being permanently associated with your commits and contributions. note that some projects are moving away from GitHub hosting for moral or ethical reasons, so this isn't a purely theoretical concern

thorn star
#

If you choose to you can find it in your settings here:

#

You can also change your email on a repository basis I believe, but someone can confirm or deny that. So if you need to use a different address for a non-Github repository, you could.

#

Note that in order to get that email address in the image there's a check box below (not shown in the image) labelled "Keep my email addresses private" that you'll need selected.

thorn star
# full steeple

This is what I was showing, I guess I didn't recognize the text, my bad.

full steeple
vital lava
manic fiber
#

should work

plush horizon
#

I leave my global user.name and user.email unset, then set them locally in each local repo clone (usually with a git alias I've defined like git config-personal). GitHub's noreply addresses are great for that. my user.name for commits is always set to my user handle on the git hosting service. you can configure GitHub in particular to block commits that would disclose one of your actual email addresses.

still iron
#

git desktop says i'm 691 behind. how to force it to catch up?

#

also that merge button is scary

#

current repo is djdevon3/adafruit_circuitpython

thorn star
#

Then you can fetch from GitHub Desktop which is pointing to your remote that you just sync'd to the upstream

still iron
#

Gah I forgot that step. ๐Ÿคฆโ€โ™‚๏ธ

icy halo
#

Hi all! Is there a guide to best practices for using the Mu editor's save-directly-to-device-and-run workflow with git? I assume that I don't want the git repo on the device. What do people do?

eager violet
#

That's a good question, I'm curious to hear answers. I just have a local git repo with a bunch of CircuitPython programs and copy / paste it into code.py

icy halo
#

Or, is it better to just set up vscode? I'm a user of that but not really for anything advanced. Is there a canned setup for a similar-save-to-deploy workflow โ€” or something better?

#

What I'm doing now (with Mu) is: periodically copy code.py and whatever else to a directory on my system HD, and then commit that. But it doesn't feel very elegant โ€” and is easy to mess up.

wanton turtle
fierce field
#

A little discussion of backup copies here: https://github.com/mu-editor/mu/issues/483. I agree, some kind of "shadow" save would be helpful. But I'd like to see that in VSCode and similar editors as well, and yet haven't found any plugins that do that, though they would be easy to write.

thorn star
#

Someone made a tool called piku that is used for setting up CircuitPython projects and deploying them to devices (if I remember correctly that's what it does)

#

Not sure if that's the right tool for the job here though, since you want to work with the repo and then deploy something different to the device

#

I basically do what @eager violet and @wanton turtle do as well if it's a microcontroller. If you're working on a SBC like Raspberry Pi, you could do an editable install.

wanton turtle
thorn star
#

!I should have specified it as mraleson/piku, sorry!

thorn star
mellow sandal
#

Hey git gurus, if I'm submitting pull requests to Wippersnapper and I was told to bump the version to 52 in my first pull request. What should I do for my second pull request? Rebase off of the first, or cherry-pick the version bump to the second pull request? (I went with cherry-pick) Or something else? (Both are currently based off of Main)

cloud hound
#

I think github can do the rebase automatically on merge

mellow sandal
#

That's what I thought/hoped, i.e. no cherry pick, it'll just merge it nicely as long as not too messy auto-merge.

#

Thanks @cloud hound

sacred dune
#

Hi all! I have a folder with another repo that was cloned into it as an imported library, but I don't have a repo for it yet on github. After running git init -b main and git add ., I get this warning/hint: "You've added another git repository inside your current repository. Clones of the outer repository will not contain the contents of the embedded repository and will not know how to obtain it. If you meant to add a submodule, use: git submodule add <url> lvgl" but I want to add a submodule and the main repo it's contained in. Is there a way to create/push the repo and have the submodule retained within it? How would I go about resolving this?

#

I'm also worried because I modified the submodule after cloning and I don't want the modifications to be overwritten. Running git submodule add https://github.com/lvgl/lvgl.git lvgl gives me "fatal: 'lvgl' already exists in the index"

queen mango
#

because if not you just need to pull the submodule every so often and commit the updated version

queen mango
#

the folder being lvgl

fierce field
sacred dune
# queen mango wait so did you modify the submodule?

I did modify the submodule but I think I might not need to if I restructure my code a bit. From looking at other repos that include LVGL, it seems the standard is leaving the external library untouched and copying templates out of it instead of renaming and using the templates directly

past kestrel
#

Hi guys, I'm in Ubuntu and made some CP changes and trying to commit to my branch, and getting an error I've never seen before:

[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: AssertionError: BUG: expected environment for python to be healthy immediately after install, please open an issue describing your environment

more info:

virtualenv python version did not match created version:
- actual version: <<error retrieving version from /home/gpeyton/.cache/pre-commit/repodk7pays9/py_env-python3/bin/python>>
- expected version: 3.10.6.final.0

Check the log at /home/gpeyton/.cache/pre-commit/pre-commit.log

Any tips? Just scared of messing up my environment!

eager violet
past kestrel
eternal stream
# icy halo Hi all! Is there a guide to best practices for using the Mu editor's save-direct...

I use VS Code for editing the git repos on my laptop. I have a command alias set up in my terminal so that when I enter the command โ€œcpcโ€, it runs the command โ€œcp code.py /Volumes/CIRCUITPY/code.pyโ€ which copies code.py from the current working directory to the CircuitPython device mounted on my Mac. I usually have a couple tabs in iTerm, one of them just for copying files, and one for tio connecting to the serial io. Tio is great at reconnecting after reboots.

static yoke
#

Hi guys so I'm having a problem with setting up my pi zero w with pitft screen using retropie command prompts I've been following the guide for the pigrrl zero but the installation code that's on the guide doesn't do what its supposed to do

cloud hound
pine plume
#

Where is a good place to ask about frozen modules, i.e. accessing them after compiling?

#

I followed the instructions on the Adafruit Learn page and had a successful compile of DotStar into a Trinket M0 build.

#

Copied the .UF2 and awesomeness. But I can't figure out how to import the frozen module. Nothing on the Learn page about THAT. I tried adafruit_dotstar and Adafruit_CircuitPython_DotStar

#

Nada

sturdy talon
#

Hmm.

#

That's odd, that's exactly how it's supposed to work. The correct form is import adafruit_dotstar.

pine plume
#

IKR?

#

I had no errors on the compile and set the .mk as directed on the Learn page.

sturdy talon
#

OK give me a moment.

pine plume
#

I looked at the .py for the DotStar and saw that is was called adafruit_dotstar so I tried it. Still says no module by that name. ๐Ÿคจ

sturdy talon
#

I'm thinking there's a step you missed in adding it. Can you send me the UF2 please? I'll grab a trinket and try it.

pine plume
#

Wow, great. Where do I send it ?

sturdy talon
#

Drag and drop it into Discord. It should add it to a message, and you can send it here.

pine plume
#

k

sturdy talon
pine plume
#

The App

sturdy talon
#

Perfect.

pine plume
#

That is the build output. Duh. ๐Ÿ™‚

sturdy talon
#

No worries.

#

So here's the issue.

pine plume
#

k

sturdy talon
#

There's not enough room on Trinket M0 to build DotStar into it. The reason nothing is working is that it's failing memory allocation as it tries to import DotStar. So it's not that the module isn't found, it's that it can't actually import it properly.

#

Can you post your mpconfigboard.mk file here as well? I'd like to check what you did anyway.

#

You may have done it all properly.

pine plume
#

Ah, interesting. So I have to use it from the /lib

sturdy talon
#

Yes, it appears so.

#

That's the reason it's not already frozen in. ๐Ÿ™‚

pine plume
#

yeah, gimme a sec

sturdy talon
#

There's no external flash on Trinket, which is to say a flash chip separate from the microcontroller chip.

#

So it's space is very tight.

#

@pine plume And a thought occurred to me now - this conversation would have been better suited to #help-with-circuitpython. No worries! I happened to notice it here. But you'll get more opportunities for assistance in that channel for questions like this in the future. ๐Ÿ™‚

pine plume
#

Purrrfect

#

I am assuming, then, that the compiler does not report that module as being too big to fit in the core CP binary for that board.

sturdy talon
#

In fact, it does. The build will fail to complete and it will tell you how much too big it is.

#

I managed to get the same results you're having.

#

I got past the memory error by shortening up my code.

#

So we'll troubleshoot your freezing process now.

pine plume
#

Ohhh! Okay.

sturdy talon
#

OK, that looks right.

pine plume
#

Am I misunderstanding the build output? Looks like it worked.

sturdy talon
#

Did you drag the library directory into the frozen directory in root of the CircuitPython repo clone?

sturdy talon
pine plume
#

No, it was already there.

sturdy talon
#

Oh right.

pine plume
#

okay ๐Ÿ™‚

sturdy talon
#

It's frozen into other things, yeah.

pine plume
#

Gotcha.

sturdy talon
#

Hmph.

pine plume
#

Memory on the Trinky has always been a problem ๐Ÿ˜ฆ

sturdy talon
#

Yeah, for sure.

pine plume
#

I was just trying to be clever.

sturdy talon
#

Ok, we're building it with DotStar frozen in to see what happens.

pine plume
#

k

sturdy talon
#

So I don't think you missed any steps.

pine plume
#

Pretty simple, it seemed. And there are no other frozen modules I can remove from the Trinky!

sturdy talon
#

Side note, you should always run make BOARD=board_name clean before you do a new build. That removes any possible previous build data so nothing gets smushed up.

#

Good practice anyway. Even if you've never built before. Because you'll almost certainly build again. ๐Ÿ™‚

pine plume
#

This was my first ever.

#

I will use the "clean" from now on.

sturdy talon
#

OK, now it tries to import dotstar, but fails on the dependency adafruit_pixelbuf. We're trying to freeze that as well.

pine plume
#

I guess I should be turning verbose on to see this?

sturdy talon
#

Actually, make clean is necessary if you change mpconfigboard.mk or other make-related files.

pine plume
#

k ! thanks !

sturdy talon
pine plume
#

Well, ๐Ÿ’ฉ

sturdy talon
#

So this time CircuitPython isn't complaining about not finding DotStar, it's complaining about not finding it's mate.

pine plume
#

It did not give me that in the REPL

sturdy talon
#

Your build gave me DotStar not found.

#

So, I replicated your issue.

pine plume
#

k

sturdy talon
#

Ooh, it imports!

pine plume
#

๐Ÿ˜ 

#

Happy for ya ๐Ÿ™‚

sturdy talon
#

OK, so I'll send you this build. You have to download the library bundle from https://circuitpython.org/libraries for 8.x, and get adafruit_pixelbuf.mpy out of it and toss it on your Trinket in the lib folder. That's the dependency DotStar wants.

pine plume
#

Ok

sturdy talon
#

Let's at least test that it works for you too.

#

And if it does, try doing the make clean before the make build, and see if that helps your build.

pine plume
#

k lemme grab my Trinky

sturdy talon
#

Wait. I just loaded that new build, and it's still not working for me.

pine plume
#

Nor I.

sturdy talon
#

Somethings not right, it's not reading the same version as it should. Hold on.

pine plume
#

No problems, I got all the day. But don't burn your time on this.

sturdy talon
#

No worries, now it's challenging me. Must figure it out!

#

I'm getting help. ๐Ÿ™‚

pine plume
#

I feel the pain.

#

I know about the dependancies, and I thought the compiler would complain about them. But, eh.

sturdy talon
#

Compiler doesn't complain. It's CircuitPython that complains when you manage to import the lib with the dependency.

#

Compiler doesn't care, you are correct.

pine plume
#

Gotcha.

#

I was just sooo happy that my first ever core build worked, my hubris demanded I try a frozen module. And, here we are.

sturdy talon
#

I'll find out if we did anything different to make it work.

pine plume
#

๐Ÿ˜„ ๐Ÿ˜„

sturdy talon
#

But first, we have to figure out why my firmware isn't the right one.

pine plume
#

If you want to pop over to the circuitpython channel, I can do that.

sturdy talon
#

Sure!

mellow sandal
#

This library is not updated in the registry, can someone take a look please https://github.com/adafruit/Adafruit_LvGL_Glue/issues/15#issuecomment-1337411808
Sorry for cross-posting, I've bunged the same issue in arduino by mistake as this channel seems more appropriate.

GitHub

Compile Error details; .pio/libdeps/nodemcuv2/Adafruit LittlevGL Glue Library/Adafruit_LvGL_Glue.h:46:3: error: 'lv_disp_buf_t' does not name a type; did you mean 'lv_disp_d...

agile hinge
#

After making a minor code change, started seeing a pylint workflow error for a previously-submitted Community Bundle library. Pre-commit had no issues and the error is unrelated to the code change. Were there changes made to the build process for Community Bundle source repositories or am I missing something obvious?

thorn star
#

Upgrading to the latest pylint in .pre-commit-config.yaml and regenerating the .pylintrc file will fix it

#

You may find some new uncovered linting issues with the new pylint, just a heads up

#

You can either pip install that version of pylint and use pylint --generate-rcfile > .pylintrc to create it, or reference any of the Adafruit bundle libraries, they all have this issue fixed.

#

They use pylint 2.15.5 I believe so I would pin it to that and then just copy that .pylintrc it has if you go that route

agile hinge
#

Ah yes, I see that there's a version change in there when comparing it to a recent cookiecutter-generated repo (that is working). Thank you for your quick and helpful reply @thorn star !

thorn star
#

No problem! Luckily it was something I fixed so I recognized it hans

agile hinge
#

I've got a bunch of these that'll need fixing. ๐Ÿค”

#

It's working! All I had to do was change the version number in the .pre-commit-config.yaml file, but am copying over a working .pylintrc just to put a bow on it. Some day I may begin to understand CI, hopefully.

#

Thanks again and have a wonderful holiday, @thorn star !

thorn star
#

My pleasure! Happy holidays!

silent fog
#

Is there a generally accepted way to give attribution in git commits?
Making an @ mention to a github/gitlab/etc. account seems dependent on which service you're pushing to.

#

Specifically, I got a great review of a repo's README, and I want to thank the person.

cloud hound
#

first name last name is generally accepted in legal sense

jaunty pulsar
#

good to know

silent fog
vital lava
#

if they commented on a given platform, using their handle that they use on that platform might work

cedar temple
#

Anybody know if there's a good way to make tree exclude with the rules from your .gitignore?

#

I googled around a bit, didn't see anything particularly elegant unfortunately

spare coral
cloud hound
#

the tree command in linux, I'd wager

cedar temple
#

Yeah itโ€™s a fairly common (but not always default-installed) program that prints a directory tree to the console. The -I flag will ignore a directory, but Iโ€™d like to ignore the whole list of files specified by .gitignore

fierce field
#

tree is v2.0.2

cedar temple
#

Woah! I checked just now on Debian 11.6, tree 1.8, doesnโ€™t seem to have the option. On my Mac, brew installs 2.something, which does

#

Too bad itโ€™s not in debian stable. Thanks for finding it though!

fierce field
cedar temple
#

what's the argument for merge commits, as opposed to linear history?

#

I guess it might help you filter on important points in history, without squashing commits or tagging?

cedar temple
#

I wonder if there's a way to force a merge commit, but only allow a merge if you could have fast forwarded?

fierce field
#

My personal experience has been that it's a lot easier to mess up a rebase. I even went to a talk a few years ago where someone was extolling the virtues of rebase in an demo example, and managed to mess it up. A clean line of commits is nice, but we've found it doesn't really make a lot of difference in the long run when examining history.
A websearch will give you some essays describing the trade-offs

vital lava
#

yeah. every merge event is an opportunity for hidden merge conflicts. even if overlapping lines are not modified, there can be semantic changes that make the merge break the code. every commit that's updated during a rebase effectively counts as its own merge, so that's many more places for that effect to happen

fierce field
#

@cedar temple ^^ last 2

keen thicket
#

can i ask question related gitlab here?

fierce field
keen thicket
#
Exception has occurred: InvalidGitRepositoryError
exception: no description
  File "C:\Users\Administrator\Desktop\New folder\project\cloud download\cloud.py", line 19, in <module>
    repo = git.Repo(download_path)
cedar temple
#

usually when you clone, it creates a new dir that actually has the repo in it

#

not sure if that's what's happening here? maybe you're one directory up from where you need to be?

keen thicket
#

it's 5:28 am here lil clueless , i just created a new folder in local dir and tried to get files from repo's sub folder

#

also project id can be obtained by two methods one is by visting url wit token id another under poject name both should be same but they are differernt

keen thicket
#

fixed it

#

3 hrs not bad

cedar temple
fossil warren
#

it seems like you have leaked a PAT. I'd remove it from the message and regenerate it on gitlab. PAT are like passwords. DO NOT share em ; )

fierce field
#

@keen thicket I have deleted that message with your code because you leaked a private credential. You should revoke it as well, since it has already been in public

true stump
#

Thanks.

steady cape
#

I'm having problems pushing to my fork of the Adafruit_CircuitPython_MCP2515, I have no idea what this "Run Build CI Workflow" is, it starts on my GitHub after I push the committed changes to the fork on my github. This is the first time that I've ever worked on someone else's repo, I've only used git with my own repositories...

#

What is this "Hook ID:black" and how can I fix it? I'd guess this is also why it exits with code 1

cloud hound
#

you can pip install black on your machine and then run it on the files you have modified, and it will reformat them

#

it's practically impossible to guess what it didn't like in your formatting otherwise

steady cape
#

Great, that fixed the problem

true stump
#

probably a simple question for those in the know: if i add an (existing) remote, i have to specify a remote name. What is this? id say that the name of the repo is the name (basically the url), but that is already specified in the add command. using vs code.

thorn star
#

The remote name is a (typically short) user-identifiable name for the the remote. An example is origin which is often the remote name of the main remote. Additionally, if I were to fork something on GitHub (say adafruit/circuitpython so I have tekktrik/circuitpython) and clone that fork, traditionally tekktrik/circuitpython would be origin and adafruit/circuitpython would be upstream.

#

Remote names are used in a few places, like if I wanted to merge the upstream's (adafruit/circuitpython) main branch into my local one, I would do git pull upstream main.

#

It saves you having to ever have to type out the full git URL

#

@true stump This sorry for the delayed tag

true stump
#

thanks for the answer. so, i have created repos (via github classroom) for my students. i want them to have the repo reflect whats on their Pyportal. they open Volumes/Circuitpy and then (from here i dont know) they add remote. vs code ask for a name. when i give it "origin", it says it already exists.

thorn star
#

origin is typically the default name when you clone, so no surprise that it's taken. You can use any name you like, so pick one that sounds descriptive. My recommendation is that you may need to type it a lot so make it relatively short. Based on your explanation, you could use example, teacher, or demo, but anything (besides origin) should work.

#

If their repository is a fork of your own repo, they could also use upstream to reflect that.

true stump
#

but i want to use the "origin" one, for all of them, for simplicity. so how do i "connect" to that repo (-name) without adding a new name or it doesnt matter? my knowledge is little as you see, i can hardly formulate the question ๐Ÿ™‚

thorn star
#

@true stump Are you asking how they can connect their forks to your own repo?

true stump
#

@thorn star no, they all have their own repo (github classoom sees to that)

thorn star
#

@true stump and they're going to connect it to yours, right? If so, you'll either need to pick a non-origin name (since their own remote would be origin) or have them rename their own remote name off of origin.

#

Note that the latter option comes with the complication that many online guides and tutorials may assume your own remote is named origin so outside help may be more difficult to use if they aren't aware of that.

#

If that is an issue.

#

Oh wait I think I understand

#

No, if you're connecting to a different git remote URL, you must give it a name

true stump
#

@thorn star no i have a repo template, classroom copies this so they get their own. theyre gonna stay and do the PRs to their own (till the course ends). maybe they just do push instead of add?

thorn star
#

If they're getting a copy of the repo, it is likely much easier for them to push to their own repositories. If they can push to a shared one (if I understand correctly), you'll need to be careful with both how they name their branches (you don't want multiple students pushing their code to the same branch) as well as what branches can be pushed to (make sure only you can push to main, for example).

#

But to be honest, I'm not familiar with GitHub Classroom so there may be pieces I'm missing.

true stump
#

just tried it, push also ask for a name...

thorn star
#

What happens if you use git remote?

true stump
#

well, we can forget about copies and how the repos were created. if i have a repo on github, and want it to reflect whats on my pyportal, how do i do? sorry about confusion

#
CIRCUITPY axelmansson$ pwd
/Volumes/CIRCUITPY
Axels-MacBook-Pro-1602:CIRCUITPY axelmansson$ git remote
fatal: Unable to read current working directory: No such file or directory
thorn star
#

Have you used git before? I ask because I can provide resources if that's the case.

true stump
#

basicallly no CLi, trying to start using it from within vs code for pedagogical reasons

#

my orignal plan was to have them clone their own repo to the Pyportal, but github Desktop and Classroom create a folder (based on their user name and classroom) not on root, so the pyportal wont se code.py on the root..

#

so that didnt work (easily). now im asking to go the opposite way; have the repo reflect whats on the root on CPY. but then i got this name issue..

thorn star
thorn star
thorn star
true stump
thorn star
#

The name is a just a shorthand reference for that URL

true stump
#

well, we did drag and drop inside vs code to elevate the files from the folder to the root and then push it.. i think i worked, but the class ended before i could confirm

#

yeah, probably ill just have them use a name, but i can feel the issues coming up if they choose freely

#

pull from?

thorn star
true stump
#

well, that gave me conflicts

#

im gonna format the CPY now

#

well, after formatting, there are still (newly created) files on the root of the CPY, and you cant clone into a folder that is not empty... if i clone via Github Desktop it creates a folder on CPY, not root, so it wont work. if i moved the files, its no longer in the folder connected to the repo. this is a special case i guess.

#

@pallid thicket clones the repo to the HDD and then copy paste into the CPY when testing, but i can see my students forgetting/confused which is which. this is high school i should add..

cloud hound
#

keeping a repo on the CIRCUITPY drive is generally not the best idea

#

I recommend keeping it on your disk, and only copying the files as needed

true stump
cloud hound
true stump
#

its just really nice to commit/push when you solved an issue without having to keep track of which version is in the HDD folder (and libs et al)

cloud hound
#

also the flash memory on which it is all stored has some limits on the number of writes it can survive

true stump
#

aha

cloud hound
#

the number is large, but by making, say, 10 times more writes, you make it 10 times smaller...

true stump
#

well, we need a learn guide on best practice (for high school students that know nothing of CLI) connecting Vs Code-CPY-github methinks..

thorn star
#

I agree that actually doing git on the drive isn't advisable, sorry I should have mentioned that.

#

If you see a guide that you think would benefit from that information, please feel free to use the link in it to suggest so. I believe it's something like "Feedback? Corrections?".

true stump
frozen remnant
#

is there a git repo with 3D models in it, like the circuit playground...I downmloaded one in the past and I cannot remember where from, thanks!

true stump
frozen remnant
#

that did the trick, thank you

jade crane
#

I'm trying to setup a pygamer with a mario type game. going well until this... in__init__ File "adafruit_pybadger/pybadger_base.py", line 156, in __init__ ValueError: SPEAKER_ENABLE in use Not sure how to fix this error. is anyone in the know on the pygamer tip?

sturdy talon
#

Actually scratch that.

jade crane
#

posted there too

#

sorry

#

i didnt know where best to put this

sturdy talon
#

Ah ok. No worries. Avoid it in the future. Most of the folks here are community members volunteering their time, so please be patient with folks in terms of responding to you. The server is often more active earlier in the day Eastern Time.

jade crane
#

ok

sturdy talon
#

Thanks!

full steeple
#

I have a new machine that's linked with my other machine. So my github folder mirrored over. So github is complaining that my repo has files in it and it can't clone

#

This seems like a solved problem?

#

Oh duh

azure stump
full steeple
#

Oh yes sorry

#

Got distracted

#

Didn't notice the obvious menu option

waxen hill
#

I use rsync for direct PC to PC transfer for large transfers (bought a new PC). Usually to an otherwise empty directory, then manage it locally (assuming the landing zone is large enough to contain two copies of all that was brought over ;)

#

(Linux-centric obviously; idk what other OS's provide for similar function).
For git, git clone is usual, I think.

#

I always make a local git clone of a local repository so there's three in total; two local and one on github, all pointing to the same commits. ;)
I call them 'origin' (github hosted) and 'localorigin' (self-hosted thru filesystem).

#

That way I get a 'push and forget' strategy going and do frequent commits. Very frequent.
Then merge every so often and push to github.

#

'top down; bottom up; middle out' dev strategy falls out of that thru commit history review. ;)

hasty maple
#

Second to rsync , very versatile in linux making files available elsewhere such as Google drive

#

I ran rsync as a deamon in a headless Ubuntu server. Worked very well with about a minute each side of file modifications to sync elsewhere

quaint bramble
#

Hello! I recently setup a NAS at home. I am a pretty new python programmer but I am starting to get to the point I want to do proper version control. I was exploring the options of using github, or setting up a git server on my synology nas (supported) . I am just wondering what you guys with more experience think? I am using pycharm community as a IDE

true stump
quaint bramble
#

Okay

#

sounds good ๐Ÿ™‚

carmine wedge
#

I used pycharm for version control with git and github. So I would recommend it.

quaint bramble
#

I am in the process of setting it up

#

I had created the git repo, but then realized I had a ton of stuff i needed to delete

#

now im trying to figure out how to remove it from the repo

#

basically I had a bunhc of large files in the directory. So i went to push and I got an error from github for the file size. So I deleted them then commited and pushed but its still trying to push the large files i deleted

stray radish
#

Has anyone here used GitHub Pages? I set up a really basic page and was hoping someone here had one theyโ€™d be willing to share. If you share an example that required any special services you had to sign up for or complicated build steps please say so. Just so I know whatโ€™s required to make something similar.

loud night
stray radish
# loud night Just looking to have a landing static page?

Thatโ€™s enough to start with, yes. Long term Iโ€™d like to make it slightly interactive, but anything beyond three lines of text in the default template is a win a far as Iโ€™m concerned. This is all I have been able to get working so far:
http://griffin-instruments.github.io

loud night
stray radish
loud night
steady carbon
#

What is git status meaning when it says, e.g.:

    modified:   lib/tinyusb (new commits)
    modified:   ports/broadcom/firmware (modified content)
cloud hound
#

those are submodules

#

other repositories checked out inside your repository

steady carbon
cloud hound
#

yes

#

if you enter that directory and do git status, you will see details

steady carbon
#

I just pulled the whole circuitpython repo. Why I get this information? Should I do something?

cloud hound
#

make fetch-submodules

steady carbon
#

ok, didn't know that I should do this from time to time

#

but the thing with broadcom/firmwareis allready there

#

but I think, this is not where I'm working on. Maybe it's better if I don't care

vital lava
#

this sort of thing can sometimes happen if a repository contains generated files that were checked in, and your local build somehow regenerated those files

#

(generally, generated files should not be checked into version control without good reason. if there is good reason, the default build process should not regenerate them, if possible, to avoid this sort of confusion)

night reef
steady carbon
#

Is my circuitpython fork allways up to date? If not, how can I update it?

gritty mural
signal turret
#

Hi

#

I updated my board build files (BrainBoardz Neuron) on adafruit/circuitpython about two weeks ago. At the time circuitpython.org was on version 8.0.3. I recently noticed the CP is now on 8.0.4. That update happened about a week after my pull request was approved. But, when I test that firmware (and the 8.1.0 beta) on circuitpython.org the firmware does not contain the changes implemented in my last board files update. Is there is a significant delay between adafruit/circuitpython file changes and when changes are implemented on firmware files are being generated for circuitpython.org? If not perhaps something I missed?

fierce field
#

without backporting your changes to 8.0.x, they will not show up in an 8.0.x release, and we are not at the moment planning another 8.0.x, as we don't have a serious bug to fix there right now

signal turret
#

Thanks for the clarification. I'll wait for 8.1.0 beta.1 then. I'll also post to #circuit-python-dev from here on.

lofty chasm
#

I submitted a pull request for seesaw the other day. It failed CI with a very helpful 'This job failed' error. I boggle.

azure stump
fierce field
#

rerunning

#

@lofty chasm @azure stump I think the problem is that .github/workflows/build.yml was specifying ubuntu-16.04, which was discontinued by GitHub Actions in September 2021 ๐Ÿ™‚

#

There are further changes to be made to bring it up to date.

azure stump
#

Thanks @fierce field

lofty chasm
#

Aha, yeah that's just a little bit old. :)

steady carbon
#

Where is the documentation located?

gritty mural
steady carbon
#

The documentation of usb_cdc

gritty mural
#

For circuitpython?

steady carbon
#

yes

steady carbon
#

I want to make a pull request. I need the location in the source, if it is there ๐Ÿค”

gritty mural
#

Whoops sorry

#

You need to fork it, make your changes on a branch, test, and then submit a PR

steady carbon
#

@gritty mural sorry that I can't say what I want.
I've probably found a mistake in the documentation. Is the documentation also written in the circuitpython repo?

gritty mural
fierce field
steady carbon
#

@fierce field thanks. This is what I was trying to find.

sturdy talon
#

I have completely forgotten how to delete a branch.

#

hashtaglazyweb

gritty mural
#

I believe itโ€™s git prune

sturdy talon
#

I've never heard of that. Does it clear out multiples? I only want to delete one.

#

I thought it was git branch -SOMETHING branch-name

#

prune looks handy though.

#

It does not appear to work on one branch though.

gritty mural
#

You can also do git branch โ€”delete <branch>

sturdy talon
#

Guess I could have used -help in the first place. ๐Ÿคฆ๐Ÿปโ€โ™€๏ธ

gritty mural
#

Lol

sturdy talon
#

-d also works, apparently.

gritty mural
#

Mhmm

#

Glad you got it figured out ๐Ÿ™‚

sturdy talon
#

Hahaha, thank you. And thank you for accommodating my laziness and forgetfulness. ๐Ÿ˜„

gritty mural
#

Mark of a true software developer (even tangential ones) is the ability to source out knowledge by all means except the official source documentation

sturdy talon
#

Nice

waxen hill
# gritty mural I believe itโ€™s `git prune`

fwiw prune removes unreferenced objects, it doesn't affect branches. It's not really ever meant to be called directly โ€” it's automatically called as part of automatic git gcs.

You might also see git remote prune, which deletes remote tracking refs which no longer exist on the remote โ€” this one's definitely good to know.

gritty mural
#

Yeah, I was thinking if you deleted a branch on your remote repository and didnโ€™t do that locally. Post branch delete actions. Lolโ€ฆ

waxen hill
#

yep! so you wanna git branch -d local and git remote prune origin (or whatever your remote name is)

#

otherwise you'll still see it listed as remotes/origin/blah when you git branch -a

gritty mural
#

Yeah, this is the issue with me trying to help while working lol.. I canโ€™t nuance my own thoughts in my head to be clear lol

#

Yay adulting

waxen hill
#

i used to work on git systems at github so i plan to squat this channel basically ^_^v

gritty mural
#

Lol good to know we have an expert ๐Ÿ˜„

fierce field
waxen hill
#

thank you! happy to help

waxen hill
#

Not hardware but don't I have a way within GitHub pages, to force mobile viewers to use the desktop site?

fossil warren
#

Say I have an open pr in a project, and have commited stuff to that PR. Now the class where that code would go was extracted and split into two classes. My code being the one in the new class

#

What do I do

#

Because if I try to rebase my branch onto upstream I can't because my commits apply code onto file where those fucntions don't exist anymore

fossil warren
gritty mural
fossil warren
#

I guess I can just put all the incoming changes onto my branch

gritty mural
#

Close your current PR with a comment about how recent merged code broke your PR

#

Or you could rebase

#

But it could be messy

jaunty stump
# fossil warren Because if I try to rebase my branch onto upstream I can't because my commits ap...

When a refactoring change, code moving to other locations as yours is, causes my branch to become chaos I often will make sure that the current state of the PR works on the pre-chaos commit point and then do one of two things depending on what is important to you
If keeping a clean history is important: do a single commit that brings in the new structure and then another commit to show what you needed to change. Having a commit be broken for a short bit is ok, for this the path to correctness is the key
If keeping the code functional is your goal, then drop the branch and PR in the rubbish bin and start over as the point is to give the project something new. This can be done via a rebase or just brute force.

fossil warren
jaunty stump
lofty chasm
#

Ow my head. How did that edit sneak into *that* branch. (rhetorical)

still iron
#

that wasn't a link but ok dynobot ๐Ÿ˜ค

#

i feel like i did it wrong. i did pull origin and tried to make sure both repos matched before submitting the PR

#

i only want to merge the 1 part not the whole library... just want to ensure i'm not going to mess anything up if it's saying merge the entire cad parts library.

fierce field
#

Don't make a PR from main. Make your own branch first. But it sounds like your fork was far behind.

still iron
#

i should make a branch for every part?

fierce field
#

How many parts are you submitting?

still iron
#

just 1 3d model in different formats

fierce field
#

If you edit main, then your main can become different from upstream's main. It's better to have your main be the same as upstream. So always branch. You can submit multiple parts in one PR on that branch.

still iron
#

adafruit part# 4392

#

i tried to make mine the same as main ๐Ÿ˜ฆ

still iron
#

will read thank you

#

should i remove that pr? is that possible?

fierce field
#

You could just delete your fork and make a new fork again. Then clone it, make a branch, make the edits, and commit.

#

you can just close the PR

#

no harm done

#

not a big deal. If you think your PR is OK, then it can be reviewed anyway. I'm giving longer-term advice.

#

I thought maybe you had a zillion changes

#

but I see that is not the case

still iron
#

Makes sense. If I'm pushing to my own personal projects repo I just work from the main fork but for adafruit stuff i should be creating branches too.

#

and i don't need to keep forks open unless i'm working on something in it. like for circuit python main i rarely contribute so can just delete/create a fork every time i want to contribute something.

#

slowly starting to get the hang of it, thank you.

sturdy talon
#

Wait...

#

Not quite ๐Ÿ˜„

#

(I'll let Dan reply first.)

fierce field
# still iron Makes sense. If I'm pushing to my own personal projects repo I just work from t...

I wouldn't say you need to create/delete a fork. If you work on your own branch, but keep its main up to date, then you can keep the same fork. I have never re-created my circuitpython fork. I "have" re-cloned it any number of times. Once your PR is accepted, you can delete the PR branch, but you don't have to, if you want to keep it for posterity (but it's in the PR, so you can always look it up). I was just suggesting deleting your fork now in case you don't want to try to clean up the main branch in it.

sturdy talon
#

And that is why I waited for Dan to reply. Heh.

still iron
#

yeah deleting and starting fresh

#

ahh i see all i had to do was delete the folder and reclone

sturdy talon
#

Yes!

still iron
#

i'm using github desktop so no cmd line. i like it.

#

well now it's doubly freshy fresh ๐Ÿ˜…

sturdy talon
#

The thing is you want to make sure you keep your fork up to date. Not every day or anything. But before you start a contribution, it's best to do whatever is GitHub Desktop's equivalent of git pull the-original-remote main and git push your-remote main. That way you're starting on the same page from your fork and the original repo. Also, there's a button on GitHub that will update your fork.

#

Don't worry right this minute. Essentially, there are some basic things you want to do as your contribution process to make sure everything goes smoothly every time. You'll get the hang of it the more you do it. ๐Ÿ™‚

#

Took me a bit, but now it's automatic. I still don't know how to do a lot of Git things, but my basic workflow is pretty solid now.

still iron
#

Now it's asking if i want to merge my new branch with my new main

#

thought i was starting to understand it but nope

#

i have to review and approve a pull request for my own branch to main, weird.

fierce field
#

checkout your present main and do a push -f to override the old stuff you pushed to main for the PR

#

you don't need to PR your own fork

#

I mean delete the fork on GitHub, not just remove the clone.

#

fork != clone

#

the guide will get you started

still iron
#

think i got it

#

it's not saying merge branch main this time at least

flat trail
#

I'm using Visual Studio (not VS code) to edit, and it creates a .vs folder in my local repo. I'm not going to git add that folder, but is there any way to silence the notifications I get about it from git status.? I want to do this purely locally, so I don't disturb origin when I submit my changes.

cloud hound
#

add it to your global git ignore

waxen hill
#

you can also add it to the file .git\info\exclude -- that's per-repo, but won't be tracked

flat trail
#

Next problem. working through the flow on https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github/status-add-commit-push I'm to the point I want to push. I entered:

git push -u origin dhcp-buffer-overrun

and was greeted by the following:

error: src refspec dhcp-buffer-overrun does not match any
error: failed to push some refs to 'https://github.com/dgnuff/Adafruit_CircuitPython_Wiznet5k.git'

which kinda makes me say "Well no kidding, Captain Obvious". Of course dhcp-buffer-overrun doesn't exist on my github repo because I haven't pushed it yet.

waxen hill
#

src refspec means it can't see your local one yet!

#

are you certain the local branch is called that?

#

what does git branch -a show?

flat trail
#

derp - it's dhcp-buffer-overflow not overrun.

waxen hill
#

:D

storm island
#

Iโ€™m having a problem with connecting Makecode with github. I follow the process but keep getting an incorrect token format. Any ideas out there

waxen hill
#

maybe some screenshots of what you're seeing would help? it's hard to know what you're trying or getting.

kind kite
#

i have a git account and press this link in Makecode

#

it takes me here and I select REPOs scope

#

i generate a token. I copy the token and paste it back into Makecode and press Go ahead and it pops up a red box with "invalid token format" shown on the screen. I can't capture it because it only stays up for a second.

sturdy talon
# kind kite i generate a token. I copy the token and paste it back into Makecode and press ...

You pasted a screenshot showing your GitHub token. Please remove the image, and generate a new GitHub token as soon as possible. You should never share your actual token with anyone. They're meant to be kept private as they allow entities to interact with your GitHub account using the features scoped out in the token. You haven't done anything wrong. I'm simply ensuring you keep your account safe!

sturdy talon
kind kite
#

i can delete the token in git hub so it is no longer valid.

#

also it only allows access to that project and scope so no biggy

sturdy talon
#

Ok, that would be good. Delete the token in GitHub, and remember not to share the new one. ๐Ÿ™‚

kind kite
#

๐Ÿ‘

azure stump
azure stump
#

Instead of using the token, you can sign in with GitHub as shown below:

#

Looks like you will have to continue using the beta for the integration to work.

kind kite
#

Thanks Iโ€™ll give it a try

mint anchor
#

git tutorial?

sturdy talon
mint anchor
#

ohh you wrote it XD

sturdy talon
#

Ooh nice! Ok, so yeah, that guide teaches the workflow I was taught when I first started. I still use it to this day. ๐Ÿ™‚

mint anchor
#

wow

#

thank you so much!

sturdy talon
#

You're entirely welcome! Feel free to post any questions here and folks will be able to help you along the way.

lofty chasm
#

I took another crack at making a PR on 'seesaw'. It is improved! It is, however, failing on the 'install deps' part of the test, with missing dependencies on gcc-arm-embedded.

sturdy talon
lofty chasm
#

On github, yes. Upon doing the 'open pull request'.

sturdy talon
#

Ok, I don't think that's a you-problem. I think it's a CI (continuous integration, that's what runs all the checks) or GitHub problem. Can you send me a link?

lofty chasm
sturdy talon
#

Ok, I reran the job, and it failed a second time. I'm going to hand this off to someone with more Arduino CI knowledge than I have. Sit tight, and hopefully they'll get it sorted soon.

lofty chasm
#

Thank you! I'm glad to get it this far.

sturdy talon
#

Great job with that!

safe crystal
#

@lofty chasm yep, its failing as it looks like the workflow itself is sort of broken. it's nothing with the code in your PR. but also, that repo isn't super maintained, so it could be a while before there is any activity there.

lofty chasm
#

Heh, yeah I know. I have a board port to follow up with, this one is a hello world.

fierce field
#

The appearance of this diff is so weird: I have never seen this before. Does anyone know what this is trying to indicate?

dusk jungle
cloud hound
#

something broke?

flat trail
#

Need some help with https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/pull/110/checks It appears to be failinfg one of the checks, I just can't figure out what's wrong and how to fix it?

Run pre-commit run --all-files
[INFO] Initializing environment for https://github.com/python/black.
[INFO] Initializing environment for https://github.com/fsfe/reuse-tool.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/pycqa/pylint.
[INFO] Installing environment for https://github.com/python/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/fsfe/reuse-tool.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pycqa/pylint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Error: black....................................................................Failed
- hook id: black
- files were modified by this hook

Error: reformatted adafruit_wiznet5k/adafruit_wiznet5k_dhcp.py

All done! โœจ ๐Ÿฐ โœจ

That's a transcript of the error log, showing what I think caused the failure, taken directly from the page cited above.

azure stump
still iron
#

Installed latest version of GIT on WSL. Cloned a repo. How does GIT know it's me wanting to make changes? I only input the username and email, it doesn't check for a password?

#

Feel like I've only cloned a repo and not initiated some kind of login where I want to be able to make changes to things...

azure stump
#

To push to GitHub, you need a private token. So that is your "real" security.

still iron
#

yes i've already setup the name and email in the config. how to add the token into it?

#

fatal: not a git repository (or any of the parent directories): .git

still iron
#

Figured out WSL is pulling the Github login from Windows Credential Manager

azure stump
#

Yeah. Totally depends on your tools and os.

still iron
#

I probably set that up when I first setup WSL and just forgot about it. :/

azure stump
fierce field
#

We could use some expert commentary here or over in https://github.com/adafruit/circuitpython/pull/7874 (supercedes https://github.com/adafruit/circuitpython/pull/7833).

The problem is that we initially approved and merged a large PR into CircuitPython that had some large .zip files in it (about the size of all the rest of the repo). Even if the pull request had been reverted, the large files would have remained in the history. I realized this after an hour or two and did a git reset --hard to remove the merge and then a force push. That was not great but I didn't see another way to remove the history.

There is now a new PR, but it has the addition and removal of the large files in it as part of the multiple comimts. We don't usually do squash merges (in fact they are currently disabled), so the addition and removal of the large files will still be in the history.

My understanding is that if I enabled squash merges temporarily and then squash-merged this PR, the large files would then not be part of the history. But I would like someone who knows this better than me to confirm or deny that. And if you have a better idea let us know. Also if you have a better idea of what we might have done initially to undo the large merge of 7833, we would be interested.

dusk jungle
#

I'm not an expert, but it's not immediately obvious whether the hard reset was enough to remove the history. The git reflog would generally still know about those commits, so I think the .zips would still be in the repo somewhere.

still iron
#
devon@GARAGE:~/My_Circuit_Python_Projects$ git push --force My_Circuit_Python_Projects main
Username xxx
Password xxx
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/DJDevon3/My_Circuit_Python_Projects.git/'
``` at least i got it to finally ask for a password.
#

Git will ask for your GitHub username and password. When Git prompts you for your password, enter your personal access token.

fierce field
still iron
#

That doesn't work either. The requested URL returned error: 403

#

The access token is ridiculously long. Does right clicking not work for pasting it in there?

fierce field
#

@still iron If you install the gh CLI supplied by github, I think it will lead you through setting up good authentication.

still iron
#

So Ubuntu using git is different from the gh instructions?

#

man the rabbit hole just keeps going

fierce field
#

getting authentication set up on Linux can be painful. There are some helpers in /usr/share/doc/git/contrib/credential that you can use. I use to use libsecret as decribed there, but I think there is an easier way now (that is, gh will set it up for you)

still iron
#
devon@GARAGE:~$ sudo apt install gh
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gh
fierce field
#

links there about how to install gh

azure stump
#

I have only done this once. It is definitely a pain.

fierce field
#

Thanks - I saw the second link already but not the first. Doing that cleanup at the moment is secondary to getting the PR to merge without re-adding the large files in the history. Does the squash merge make sense to you?

random copper
azure stump
#

I am not 100% sure. The problem should only exist in the fork at this point. Would it be possible to do git reset --hard in the fork? And then redo those commits.

#

Sorry. This type of stuff makes my head hurt. ๐Ÿ˜ตโ€๐Ÿ’ซ

#

Also can you add .zip to the .gitignore for the future?

#

@fierce field I would try to prevent the history cleanup in the first place.

#

From what I am reading the squash merge will work.

#

I would destroy the fork and check it out again.

fierce field
#

any cleanup would eventually be done on adafruit/circuitpython. I will check on that later, after the squash merge

#

@night reef fyi ^^ start at 7:05am your time

night reef
#

I'd probably just leave the files

azure stump
#

How large is "large"?

fierce field
#

150MB

#

about the same size as all the rest of the repo

azure stump
#

That isn't too large. When I had a similar issue, the file was several GB which slowed everyone's pulls.

#

Maybe like 50-100. So awful. But it has been a while.

#

We also did a shared repo with individual branches. Not the fork model. So, I think you are safe with the squash merge. And that file doesn't exist on a branch.

#

(I think)

fierce field
azure stump
#

I don't think they ever go away.

still iron
#

Tried the hard way. Git command line and I just don't get along. Deleted the entire repo and recreated it. Problem solved.

jaunty stump
#

large blobs (binaries or other non-code files) and the shear volume of messy commits, is a huge reason why I like squashing merges when pulling things into core open-source repos -- it allows you to prune the chaos out

wise panther
jaunty stump
flat trail
#

@fierce field If you requested changes on a PR I submitted, do I have to do anything to mark the changes as complete on the PR, or is just pushing to my fork on github, and thence to the PR enough?

fierce field