IRCloggy #git 2022-04-06

Logs Search ←Prev date Next date→ Channels Documentation

Provider of IRC logs since 2005.
WARNING: As Freenode became unjoinable and lost all warnings in topics, we cannot log channels on Freenode anymore.

2022-04-06

causa_sui left00:01
parsnip https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/more00:01
Xenguy joined00:01
rgrinberg joined00:01
shailangsa going to use git bash as that resolves the issue though00:01
parsnip i would avoid cmd.exe, i thought PowerShell is the future on Windows00:02
causa_sui joined00:02
Gustavo6046 wait, windows has a future?00:02
parsnip poor choice of words :-P00:03
epony left00:03
chenqisu1 joined00:03
Gustavo6046 you sure?00:03
:P00:03
i think the Windows market share might actually go down in the following years00:04
epony joined00:04
Gustavo6046 but the details of that are a conversation for another channel00:04
parsnip one can dream00:04
Gustavo6046 lol00:04
parsnip pros and cons00:04
Gustavo6046 yeah true, they all have pros and cons00:04
it's hard to tell with linux because there are so many damn distros00:05
currently i'm using garuda00:05
epony left00:05
Gustavo6046 emphasis on I – it might not be the better choice for that many people00:05
duxsco joined00:05
Gustavo6046 it's neat, i'd say it's like one of them easy-to-use derivates of arch linux, but without manjaro's quirks, and a few other interesting features on top00:06
it's far from perfect though, and honestly everything ever is00:06
causa_sui left00:06
mud left00:08
gurkenglas left00:13
pulse left00:19
causa_sui joined00:29
plugwash joined00:32
plugwash i'm trying to set up git clone and getweb access with apache, gitweb is working but git clone is not, apache seems to be ignoring the scriptaliasmatch directive and I've no clue why00:33
any idea how to debug this?00:33
geowiesnot joined00:33
causa_sui left00:33
geowiesnot left00:43
plugwash nm I was looking at the wrong logfile, the access log was just saying 404, but the error log had more info.00:46
causa_sui joined00:52
vicfred left00:55
williewillus1williewillus00:57
causa_sui left00:58
MrMagic left01:00
Yruama left01:02
pulse joined01:07
sa0 joined01:09
causa_sui joined01:14
wonko-the-sane left01:16
dermoth left01:16
vysn joined01:18
causa_sui left01:21
wonko-the-sane joined01:23
causa_sui joined01:25
Jack_shat joined01:29
dermoth joined01:29
Jack_shat left01:30
wonko-the-sane left01:31
causa_sui left01:33
sa0 left01:41
srinidhi left01:42
wonko-the-sane joined01:43
jinsun left01:44
xiongxin joined01:45
quartz Hello. I'm still having this problem where I can't stop git from tracking my directory. I get this error: https://ibb.co/QcLZGvX01:46
I'm using the command git rm -r --cached but it's telling me the directory did not match any files.01:46
anaveragehuman joined01:47
Gustavo6046_ joined01:48
humanBird joined01:48
Gustavo6046 left01:50
Pseudocrat joined01:51
epony joined01:51
Gustavo6046_ left01:51
Gustavo6046 joined01:51
fling left01:54
MrMagic joined01:56
fling joined01:56
BSaboia I have a branch which is already pushed. In this branch I accidentally pasted some credentials on a file that should not have them. The branch is mine. I cannot delete the file. What should I do in this case?01:57
Gustavo6046_ joined02:00
junktext left02:01
Gustavo6046 left02:01
Gustavo6046_ left02:01
Gustavo6046 joined02:02
mackerman BSaboia: Change the credentials, delete the old ones, and push the deletion to all known remotes02:03
BSaboia mackerman, they are not really credentials. It's my login. But I don't want it to be in the code, nor reflog. So I cannot really change it02:05
mackerman Secrets that have been git add-ed are compromised.02:06
vysn left02:07
xiongxin left02:08
xiongxin joined02:08
mud joined02:09
mackerman You can edit history and purge all known references if you like. I still consider such secrets comprmised and should be changed.02:09
quartz left02:09
BSaboia mackerman, I cannot really change my login. It's my private email. I just didn't want it to be accessible in this company's (private) repo. But not super relevant02:11
mackerman Only the email, not auth details? That is not credentials then.02:11
Email in some file's content, or author or committer email?02:13
The latter you can hide with man gitmailmap02:13
gitinfo the gitmailmap manpage is available at https://gitirc.eu/gitmailmap.html02:13
gco joined02:18
mannequin left02:18
jimklimov left02:19
relight left02:21
Gustavo6046 left02:22
humanBird left02:24
causa_sui joined02:24
kaiseisei joined02:26
gco left02:30
Gustavo6046 joined02:30
pulse left02:30
Gustavo6046 left02:32
coaxing left02:32
causa_sui left02:32
Gustavo6046 joined02:33
jimklimov joined02:33
causa_sui joined02:34
xiongxin1 joined02:36
xiongxin left02:36
xiongxin1xiongxin02:36
causa_sui left02:39
xiongxin left02:53
causa_sui joined02:55
subopt left02:56
fling left02:59
jclsn0 joined03:00
fling joined03:00
bloody left03:01
jclsn left03:02
causa_sui left03:03
donofrio joined03:06
adhawkins_ joined03:14
adhawkins left03:15
adhawkins_adhawkins03:15
donofrio left03:16
jkl left03:17
jkl joined03:18
xiongxin joined03:26
BSaboia mackerman, file's content03:27
xiongxin left03:36
humanBird joined03:37
jimklimov left03:38
sa0 joined03:39
sudoforge left03:43
nosolls1 joined03:50
Xenguy_ joined03:51
hbautista joined03:52
nosolls1 left03:53
Xenguy left03:54
causa_sui joined03:54
plugwash left03:57
saroy joined03:58
travisghansen left04:02
fling left04:03
causa_sui left04:03
splud left04:04
tyson2 left04:04
travisghansen joined04:04
xiongxin joined04:04
fling joined04:05
cdown left04:06
cdown joined04:07
Murr left04:07
Murr joined04:08
The_Blode joined04:10
sa0 left04:11
rgrinberg left04:14
cdown left04:18
Gustavo6046 left04:21
splud joined04:21
The_Blode left04:23
analoq left04:24
rgrinberg joined04:24
splud left04:26
analoq joined04:26
gast0n left04:27
xiongxin left04:29
cdown joined04:33
The_Blode joined04:37
splud joined04:41
splud left04:43
splud joined04:43
jimklimov joined04:50
seifeslimene left04:51
jimklimov1 joined04:52
rgrinberg left04:53
causa_sui joined04:54
jimklimov left04:55
madewokherd` joined04:58
causa_sui left04:58
causa_sui joined04:59
madewokherd left05:00
c4017_ joined05:02
ChmEarl left05:02
causa_sui left05:04
c4017 left05:05
fling left05:07
fling joined05:08
hbautista left05:09
vanessa joined05:17
jinsun joined05:19
zebrag left05:22
thiago left05:22
jusski joined05:28
vysn joined05:29
bindu left05:32
jusski i am executing05:33
git checkout main -- some_file05:33
but im still seeing it in05:33
git diff --name-only main05:33
what i am doing wrong?05:33
bindu joined05:34
jusski no changes in staged05:35
parsnip what are the changes? merge conflict?05:36
> The index may contain unmerged entries because of a previous failed merge. By default, if you try to check out such an entry from the index, the checkout operation will fail and nothing will be checked out. Using -f will ignore these unmerged entries.05:37
-- https://git-scm.com/docs/git-checkout05:37
damn, as complicated as git is, the documentation is pretty good05:39
great_taste left05:39
jusski git merge main writes already up to date05:44
xiongxin joined05:45
jusski oh my bad, this file does not exists in main branch05:47
somebody moved it to another folder05:47
parsnip dang, i'm not so good at diagnosing05:49
mannequin joined05:53
jimklimov1 left05:55
walterwhip joined05:55
_9pfs joined05:55
roadie joined05:56
kenanmarasli joined05:59
causa_sui joined05:59
mexen joined06:00
anaveragehuman left06:03
causa_sui left06:04
xiongxin left06:06
Murr left06:07
Murr joined06:07
anaveragehuman joined06:08
Sh4dowmonk joined06:09
causa_sui joined06:09
mattil joined06:12
bkircher_afkbkircher06:12
causa_sui left06:14
_vanessa_ joined06:14
_vanessa_vanesaa06:16
vanessa left06:17
_vanessa_ joined06:18
otisolsen70 joined06:19
vanesaa left06:21
szymon joined06:23
xiongxin joined06:23
szymon left06:24
^vanessa^ joined06:24
causa_sui joined06:25
duxco joined06:25
duxsco left06:26
duxcoduxsco06:26
EvilDMP joined06:26
_vanessa_ left06:27
_vanessa_ joined06:27
^vanessa^ left06:30
causa_sui left06:34
palasso joined06:38
xiongxin left06:40
jimklimov joined06:42
coot joined06:44
jimklimov left06:46
TheCatBehemoth joined06:46
srinidhi joined06:51
sondr3 joined06:54
dionysus69 joined06:55
causa_sui joined06:59
Sh4dowmonk left07:02
causa_sui left07:04
feriman joined07:08
Misotauros left07:09
thomas25 I've created a branch from master. I've also checked out the master (M1) at this point. I've added a single file to branch and merged it back to master. Now, I've also made some modifications to M1. How do I push the changes I've made? (the master at the remote origin is now ahead of my local copy)07:09
_9pfs left07:10
fling left07:10
_9pfs joined07:11
duxsco left07:12
_9pfs left07:12
fling joined07:13
_9pfs joined07:13
iomari891 joined07:13
Sh4dowmonk joined07:14
skapata left07:15
cbreak thomas25: merge or rebase07:15
a1eaiactaest joined07:16
cbreak or create a new branch and push that07:16
thomas25 yeah i've followed the hints git gives me but i wish this was more intuitive, still feels like walking in the dark07:16
_vanessa_ left07:23
causa_sui joined07:24
MajorBiscuit joined07:24
sondr3 left07:25
wonko-the-sane left07:25
vimal joined07:27
causa_sui left07:28
causa_sui joined07:29
causa_sui left07:34
jimklimov joined07:34
fillx joined07:43
___nick___ joined07:45
sondr3 joined07:49
wakeup joined07:50
causa_sui joined07:54
Shentino_ joined07:55
_9pfs left07:55
Shentino left07:56
zeenk joined07:56
Shentino_Shentino07:56
_9pfs joined07:57
wonko-the-sane joined07:57
tulpa_ joined07:58
causa_sui left07:58
causa_sui joined07:59
donofrio joined08:00
causa_sui left08:04
Haohmaru joined08:06
donofrio left08:06
kaiseisei left08:08
kaiseisei joined08:08
sa0 joined08:09
geosmileus joined08:11
AnapodoPsalidaki joined08:11
kenanmarasli left08:12
geosmile left08:12
Sazhen86 joined08:13
AnapodoPsalidi left08:13
fling left08:15
chenqisu1 left08:15
MajorBiscuit left08:16
fillx left08:16
_9pfs left08:17
fling joined08:17
MajorBiscuit joined08:18
ilogger2 joined08:40
duxsco joined08:41
thomas25 joined08:42
Sulky joined08:43
swistak joined08:45
DNH joined08:46
Misotauros joined08:46
donofrio joined08:52
Cork joined08:52
ueberall joined08:54
synthmeat joined08:57
gas51627 joined08:58
causa_sui joined08:59
omero joined08:59
wonko-the-sane joined08:59
MajorBiscuit joined09:01
causa_sui left09:04
Sulky left09:14
duxsco left09:17
Sulky joined09:17
fling joined09:21
Sh4dowmonk joined09:22
Sulky left09:22
Sulky joined09:23
gurkenglas joined09:24
causa_sui joined09:24
zen_coder joined09:27
zen_coder with "git diff HEAD^ --name-only" I can see all files changes of current commit09:28
adgtl joined09:28
zen_coder how can I see what files were removed in current commit?09:28
ikke --diff-filter=D09:28
causa_sui left09:28
Sulky left09:29
causa_sui joined09:29
Sulky joined09:29
squirrel joined09:29
zen_coder ikke: thx, how can I filter out the deleted files, and show only modified and added?09:32
selckin you read the diff-filter option manual09:33
ikke man git diff09:33
gitinfo the git-diff manpage is available at https://gitirc.eu/git-diff.html09:33
causa_sui left09:34
Sulky_ joined09:34
Sulky left09:37
Sulky__ joined09:40
zen_coder I am doing now: "git diff HEAD^ --name-only --diff-filter=ACMRTUXB"09:42
Sulky_ left09:42
ikke --diff-filter=d09:43
"Also, these upper-case letters can be downcased to exclude."09:43
john_johnk joined09:43
zer0bitz joined09:48
gildasio joined09:52
dsrt^ joined09:53
causa_sui joined09:59
bluepenquin_ joined10:00
Willtech joined10:01
sa0 joined10:02
wonko-the-sane left10:03
wonko-th1-sane joined10:03
causa_sui left10:04
mic4ael joined10:06
Sazhen86 joined10:07
Murr joined10:07
john_johnk left10:11
c4017 joined10:12
Sazhen86 left10:18
john_johnk joined10:20
fling left10:23
fling joined10:23
causa_sui joined10:24
analpaper joined10:26
analpaper left10:26
analpaper joined10:26
parsnip joined10:29
vitali64 joined10:32
causa_sui left10:33
causa_sui joined10:34
causa_sui left10:43
john_johnk left10:45
ecraven joined10:46
ecraven hello ;) I'd like to find the commit that removed a file from a directory. I know the directory, but not the exact file name. is there a way to show *all* filenames that have existed in a directory, and then to find the commit that removes that file?10:47
enoq joined10:47
john_johnk joined10:48
j416 ecraven: git log -- path10:48
ecraven: git log --name-only --path10:48
er10:48
ecraven: git log --name-only -- path10:48
ecraven thanks!10:49
vishal joined10:49
ecraven perfect, thanks!10:50
tyson2 joined10:51
The_Blode joined10:51
john_johnk left10:52
Misotauros left10:53
sa0 left10:55
john_johnk joined10:55
sa0 joined10:55
apo joined10:56
canton7 ecraven, You might want --name-status, to show when each file was added/deleted/modified10:59
rsx joined11:00
ecraven really cool that this is so simple, thanks again ;)11:00
osse ecraven, j416: perhaps --diff-filter=D can do some work here too11:01
to only show commits that delete something11:01
zen_coder left11:03
lpapp joined11:04
lpapp hi, is it possible to pull the pre-receive hook code from the server to a client?11:04
To see why it might reject things11:04
Probably not as this could expose vulnerabilities11:04
ikke no, git does not expose it11:05
kenan-office joined11:05
lpapp ok, thanks, getting remote: GitLab: You can only use an existing protected branch ref as the basis of a new protected branch.11:07
but I do push a branch based on a protected branch, so was surprised what is going on, and it is ok from the gitlab ui11:07
but I guess it is a question for #gitlab11:07
bartman joined11:11
iomari891 joined11:13
zmt00 joined11:14
coaxing joined11:22
iomari891 left11:23
causa_sui joined11:24
eroux joined11:26
causa_sui left11:29
causa_sui joined11:29
menace joined11:34
menace left11:34
causa_sui left11:34
Sh4dowmonk left11:39
nyah joined11:40
causa_sui joined11:44
causa_sui left11:49
geowiesnot joined11:49
bertvvvs joined11:51
mic4ael left11:56
causa_sui joined11:59
geowiesnot left12:03
causa_sui left12:04
mic4ael joined12:05
kenan-office left12:07
wakeup joined12:13
dsrt^ left12:17
MrMagic joined12:18
Misotauros joined12:20
bloody joined12:21
v9fk1yn3nu joined12:35
sondr3 joined12:36
casaca joined12:42
dimi1947 joined12:46
Sulky__ left12:51
causa_sui joined12:54
Sulky__ joined12:55
feriman joined12:56
feriman left12:57
AbleBacon joined12:57
feriman joined12:57
causa_sui left12:59
dimi1947 left12:59
zen_coder joined13:00
duxsco joined13:02
causa_sui joined13:04
feriman left13:05
Misotauros left13:06
feriman joined13:06
iomari891 joined13:11
pulse joined13:11
cdown_ joined13:18
kenanmarasli joined13:20
cdown_cdown13:20
randm joined13:22
dimi1947 joined13:25
randm left13:27
randm joined13:27
fling left13:35
thiago joined13:36
fling joined13:37
duxsco left13:44
v9fk1yn3nu left13:45
defjam joined13:51
quartz joined13:55
squirrel left13:59
Yruama joined14:02
iomari891 left14:02
zebrag joined14:07
Murr left14:07
Xenguy__ joined14:07
Murr joined14:07
gurkenglas left14:08
Willtech left14:08
Willtech joined14:09
quartz Hello. I'm trying to remove an entire directory from being tracked by git. I'm using the command git rm -r --cached /home/nick/Desktop/Columbia\ 2022 but I get the error: fatal: pathspec '/home/nick/Desktop/Columbia 2022' did not match any files14:09
Sorry to ask this again in here, I'm just not sure how to resolve this.14:09
lpapp left14:10
structoha joined14:13
canton7 quartz, is that path right? It implies that your whole Desktop is a git reop?14:16
*a git repo14:16
Sulky__ left14:22
mackerman quartz: Have you committed the removal of that from the staging area? From previously, as git rm doesn't think it is there anymore14:22
git status would show any differences14:22
quartz Uhhh14:22
No, it's just that one folder "Columbia 2022"14:24
Which is located on the desktop14:24
mackerman If the repo is only one folder, do you want to track it git any more?14:24
quartz mackerman: Sorry I'm new to git. I want to keep the folder "Columbia 2022" on my desktop, I just want git to stop tracking it14:24
mackerman: No. I'm not sure what I did honestly. The repo and the folder are nothing alike14:25
mackerman In other words, do you plan to use this git repo any more?14:25
quartz mackerman: No14:25
mackerman Then back the folder up and delete the .git directory in it14:25
quartz When I do "ls" I don't see a .git directory14:26
a1eaiactaest joined14:26
canton7 quartz, so "Columbia 2022" is a git repository, and you want to stop it from being a git repository?14:26
mannequin well i use git quite a while now14:27
and i can say14:27
man it's smart14:27
canton7 'ls' doesn't show hidden files and folders, and since '.git' starts with a '.', it's considered hidden. Use 'ls -a'14:27
quartz canton7: No, Columbia 2022 is not a git repository. Honeslty I'm not sure wtf I did14:27
This is so confusing to me lol I'm new to git14:27
Sorry14:27
mackerman What did you think you were telling git to remove ?14:27
quartz mackerman: I just want git to stop tracking my folder "columbia 2022"14:28
canton7 quartz, can you cd into 'Columbia 2022' and run 'git rev-parse --show-toplevel' ?14:28
structoha left14:28
canton7 (and tell us what the output is?)14:28
quartz canton7: Ahh I see the .git file!14:28
OK14:28
canton7: /home/nick/Desktop/Columbia 202214:29
sentriz joined14:29
canton7 Right, so 'Columbia 2022' *is* a git repository, and you should find the folder 'Columbia 2022/.git'14:30
(something is a git repostiory if it or one of its parents has a .git dir in it)14:30
quartz Ahhh OK14:31
So I should run the command git rm -r --cached in that .git directory?14:31
canton7 No14:31
Let's just confirm what you want first. Are you sure that you want to stop 'Columbia 2022' from being a git repository? That means if you made any commits, etc, in that folder, those will be lost14:32
quartz canton7: Yes, I literally have no need for it.14:32
canton7 Cool, just delete the .git dir them. 'rm -rf .git'14:32
warblr joined14:32
quartz I was trying to commit ONE file to a repository for school, and I wanted to do it from my terminal14:32
well, I totally messed up, as you can tell14:33
I just don't want the folder "Columbia 2022" to be deleted14:33
mackerman What repo did you intend to use?14:33
quartz I just want git to stop tracking it14:33
canton7 Yep, if you run 'rm -rf .git' from inside the 'Columbia 2022' folder, then you'll just delete 'Columbia 2022/.git'14:33
quartz mackerman: Uhhh one my professor set up for us. I ended up committing my one file using the git website rather than the terminal14:34
canton7 This is where you're using confusing terminology. "Stop tracking" means that you have a git repository, and you want it to stop keep track of that folder. When in fact you don't want to keep the git repository at all14:34
*stop keeping track14:34
quartz canton7: OMG it worked! Thank you!14:35
gast0n joined14:35
structoha joined14:36
structoha left14:36
Sulky__ joined14:36
subopt joined14:39
fling left14:40
quartz So I can't commit files to a git repository from terminal just by using a password? I need some type of security hash token?14:41
canton7 quartz, remember that a git repository is entirely contained on your machine. When you commit something, you're adding it to that .git directory in the root of your repository. You don't need a password to interact with your own filesystem14:41
fling joined14:41
Willtech left14:42
canton7 If you want to *push* commits to a repository on another machne, at that point you'll probably need a password. And what you need is determined by whoever controls the machine that you're pushing to. GitHub for example lets you authenticate using an SSH key or a token -- you're not allowed to use your password, for obvious security reasons14:42
mackerman When someone already has an existing repo, like that one of your professor's, you may "git clone" it to have your own copy, entirely local.14:43
quartz mackerman: Right14:43
mackerman What to do with it after depends on your work flow, including if you need to collaborate with others and merge their changes.14:45
quartz canton7: So when I commit a file, that means I'm pushing all commits in the staging area into that .git directory? Than it's possible to "push" that .git directory into the remote github server?14:45
masber joined14:45
canton7 quartz, 'push' specifically refers to taking commits in your local repository and transferring them to a remote machine. When you commit a file, that creates a commit in your local git repository (which is stored in that .git dir)14:46
The staging area holds files which will be included in the next commit. It doesn't hold commits.14:46
quartz canton7: Ahhh OK14:46
masber hi, I am trying to rebase master changes into my branch and I get a conflict https://dpaste.org/C8WDC/raw . I have fixed README.md file, then run git add README.md && git rebase --continue and it just undo my changes and gets me back to the conflicted state14:46
canton7 I recommend starting with a good git resource, and learning from the beginning. !book is the classic text although it's quite long. !bottomup and !cs are good quicker intros14:46
gitinfo There are several good books available about git; 'Pro Git' is probably the best: https://git-scm.com/book but also look at !bottomup !cs !gcs !designers !gitt !vcbe and !parable14:46
'Git from the bottom up' starts with explaining the building blocks of git and proceeds to tell you how they fit together. https://jwiegley.github.io/git-from-the-bottom-up/14:46
"Git for Computer Scientists" is a quick introduction to git internals for people who are not scared by phrases like Directed Acyclic Graph. http://eagain.net/articles/git-for-computer-scientists/ See also !concepts !bottomup14:46
masber how should I fix the conflicts while rebasing?14:47
quartz And I thought git was suppose to be easy to learn :(14:47
canton7 quartz, whatever gave you that impression >< The secret with git is to learn about the underlying data structure -- what a commit is, how a commit refers to its parent, what a branch actually is, etc. Use graphical tools such as gitk to visualise your history. Once you can see and understand what's going on, all of the commands suddenly start14:48
making sense14:48
masber, !eek14:48
gitinfo masber: [!eekaconflict] Merge conflicts are a natural part of collaboration. When facing one, *don't panic*. Read "How to resolve conflicts" in man git-merge and http://git-scm.com/book/ch3-2.html#Basic-Merge-Conflicts then carefully go through the conflicts. Picking one side verbatim is not always the right choice! A nice video explaining merge conflicts: https://www.youtube.com/watch?v=zz7NuSCH6II14:48
canton7 (rebase and merge conflicts are pretty much the same, except that 'ours' and 'theirs' refer to different things)14:49
gh34 joined14:49
canton7 Remember that when you 'git checkout A; git rebase B', git will checkout B and then apply successive patches from A. So at any given point, you're standing on the result of the latest successfully-applied patch, and you're applying the next one. So if you get a conflict, one side is the change introduced by A + whatever patches have been applied so14:50
bar, and the other side is the next patch from B to be applied14:50
Ack got A and B confised14:50
Remember that when you 'git checkout A; git rebase B', git will checkout B and then apply successive patches from A. So at any given point, you're standing on the result of the latest successfully-applied patch, and you're applying the next one. So if you get a conflict, one side is the change introduced by *B + whatever patches have been applied14:50
so bar, and the other side is the next patch from *A to be applied14:50
masber I know that14:51
quartz Can't imagine the IQ of the guy who invented git14:52
masber what I don't understand is why git rebase --continue applies the same commit I just changed14:52
quartz canton7: Thanks for the links by the way.14:52
masber s/changed/fixed/g14:52
stef204 joined14:52
canton7 masber, well I don't know what you know unless you tell me :)14:52
masber xD true14:53
so I run git rebase master14:53
canton7 masber, when rebase hits a conflict, it will stop with that latest patch partially applied. It's up to you to fix the conflicts and 'git add' everything, then you run 'git rebase --continue', and the rebase finishes applying that patch14:53
masber it applies one commit from master at a time14:54
then it finds a conflict and stops14:54
I get that14:54
sondr3 left14:54
masber now I fix the conflict14:54
canton7 almost -- it checks out master, then applies the commits from the branch you had checked out when you ran 'git rebase master'14:54
Akiva joined14:54
dimi1947 left14:55
feriman left14:56
masber ok, wait, what?14:57
so git rebase master, actually modifies the master branch and not the one I am in?14:57
canton7 That's what I described before, and you said "I know that" >< . "git rebase master" means "Take the commits which HEAD has and master doesn't have, and play them on top of master"14:57
I should say, it checks out the commit which 'master' points to14:58
stutz joined14:58
Guest69 joined14:58
ChmEarl joined14:58
canton7 It doesn't modify the master branch -- but it jumps to the commit which master points to, then applies successive commits from the branch you had checked out when you ran 'git rebase master', then finally updates that branch to point to the last such applied commit14:58
stutz is there a way to list all branches/commits/refs that do not include a file? I am like 99.9% sure that the file I am looking at was deleted (which is the state that I want) but I can't seem to find the branch (rather the one I thought it'd be correct is not)14:59
canton7 stutz, you might be able to script something with 'git ls-tree' and 'git for-each-ref'?15:00
masber ok15:00
so let say I have master, featureA and featureB branches15:00
canton7 stutz, if you're completely failing to find this change anywhere, it might have been done as part of an !evil merge15:00
gitinfo stutz: [!evil_merge] What you describe _can_ be done, but results in an "evil merge": a commit that purports to be a merge, but does not actually take all changes from all sides. This violates the assumptions that tools and humans make about merges, and usually results in confusion and pain down the road.15:00
masber featureA and featureB forked from the same master commit15:00
then featureA and master merges15:00
rgrinberg joined15:00
masber and I want to apply those new changes to featureB branch15:01
canton7 stutz, ignore the first bit of the trigger. But an evil merge is one which makes a change that isn't present in either of its parents. The git tooling is pretty bad at finding changes introduced by evil merges15:01
masber I understand the way to do this would be to git checkout master; git rebase featureB15:01
right?15:02
canton7 masber, so both master and featureA have gained new commits, but they're still separate?15:02
stutz could be a messed up rebase for all I know, point is I'd just like to find the state where the file is gone cos that's the one I need :D15:02
masber master and featureA merges, featureA can be deleted15:02
featureA can be deleted because its changes are now in master15:03
stutz I was hoping for git to have some plumber functioni that allows me to look for a file (or its absence) but I guess scripting it is then15:03
thanks canton715:03
canton7 OK, so master has gained new commits, and you want those to be present in the featureB branch? So what you want to go from is this: https://gitirc.eu/g/QC.png to this: https://gitirc.eu/g/QC.png?15:04
masber they both same picture, but yes that is the end goal15:05
zumba_addict joined15:05
canton7 Bleh sorry. From this: https://gitirc.eu/g/QB.png to this: https://gitirc.eu/g/QC.png15:06
Or, if we want to get fancy: https://gitirc.eu/g/QG.png15:06
masber yes, that is correct :)15:07
canton7 masber, OK, so you want to take featureB, and change its commits so they're sat on top of the latest master15:08
So that's 'git checkout featureB; git rebase master'15:08
masber ok15:09
thank you15:09
canton7 Note that you're not applying changes *to* featureB -- you're taking featureB and rewriting it so that it sites on top of those new commits15:10
Sulky__ left15:11
masber yeah15:12
so master pointer is still the same and history instact15:12
canton7 Yep15:12
Gustavo6046 joined15:14
Gustavo6046 left15:15
Gustavo6046 joined15:16
a1eaiactaest left15:16
dionysus69 joined15:19
gurkenglas joined15:21
quartz canton7: Sorry to bug you again, but I can't git pull from the terminal using a user name and password anymore?15:25
canton7 quartz, like I said, it depends on what machine you're pulling from15:25
There's no global standard for how authentication is done. It depends on the server you're talking to15:26
Are you talking to github? gitlab? bitbucket? gitea? gitolite? Your friend's PC? Something else?15:26
quartz canton7: The repo I want to pull from is github15:26
canton7 Then yes, you need to use an access token or ssh key for github. You can't use your password.15:26
quartz Oh I didn't realie there were so many versions of git15:26
ecraven left15:27
canton7 They're not "versions of git". They're platforms which are built on top of git, but also provide things like authentication, a web interface, issue tracker, pull requests, etc15:27
dzho git+EEE15:31
enoq left15:32
dionysus69 left15:35
dionysus69 joined15:35
dionysus69 left15:35
dionysus69 joined15:37
sandipan joined15:41
v9fk1yn3nu joined15:44
Payam joined15:44
Payam hi15:44
How do I check if a repository is a github or gitlab repository?15:44
ikke check the url?15:44
git itself does not know about 'github repository' or 'gitlab repository'15:45
vitali64 left15:45
vitali64 joined15:45
nedbat Payam: btw, one repo can have a number of remotes, including some on github and some on gitlab15:48
Payam: what do you want to do with the repo if and only if it's a github repo?15:48
parsnip can have both as remotes too15:49
madewokherd joined15:50
Thanatermesis joined15:51
Xenguy__Xenguy15:51
Payam nedbat nothing. I only group them15:51
nedbat Payam: group them how? I'm interested15:52
Payam tbh I just am interested in Gitlab repositories15:52
so I want to "not" care about other. Just a print saying "this is a gitlab repo"15:53
hololeap_ joined16:01
bertvvvs left16:01
junktext joined16:03
parsnip probably you could have gitlab metadata there16:05
many github projects have clues, like a .github subdirectory16:05
bertvvvs joined16:05
parsnip or a README can provide a link to the remote16:05
elisp packages usually have metadata for where the source can be found16:06
saroy|afk joined16:08
sandipan left16:11
rgrinberg left16:12
jole joined16:12
john_johnk left16:12
john_johnk joined16:12
quartz left16:14
iomari891 joined16:15
sandipan joined16:16
zen_coder left16:17
napping joined16:17
napping Hi, is there any way to also change the working file during `add -p`, like if I'm correcting a typo?16:17
saroy|afk left16:19
wakeup left16:24
zumba_addict left16:30
sudoforge joined16:31
parsnip you mean you discover a typo during `add -p`? good question16:31
madewokherd left16:33
napping also if you are selecting a subset of changes with add -p and want to tag a subset with a TODO or something for a closer look after dividng the commits16:35
emanuele6 joined16:38
MajorBiscuit left16:38
emanuele6 left16:39
emanuele6 joined16:39
parsnip to the first question, i see this "e - manually edit the current hunk"16:39
at https://git-scm.com/docs/git-add16:39
napping Sure, but that only affects what's added to the index, afterwards you'll see some staged changes, and a new unstaged change reintroducing the typo16:41
liefer1 joined16:41
fling left16:44
fling joined16:46
jelmer joined16:46
jelmer left16:46
pf1337 joined16:48
jelmer joined16:49
masber left16:50
hololeap_ left16:51
xkuru joined16:51
pf1337 left16:51
hololeap_ joined16:53
geowiesnot joined16:54
parsnip i'm horrible at CLI git. i just started a tutorial16:55
stephen joined16:55
stephen how do i check which commit a branch was created from?16:55
hitman joined16:55
great_taste joined16:56
ikke git does not record that16:57
nedbat stephen: branches don't remember where they were created16:57
napping stephen: git merge-base can find a common ancestor. If you want actual history it could only be found in the reflog16:57
stephen got it, thanks16:57
napping What would you like for newbranch after git checkout -b newbranch some-branch; git reset --hard unrelated-branch16:58
skapata joined16:59
skapata left16:59
skapata joined16:59
stephen so if they don't know where they are created from, how can i rebase my specific commits onto another branch16:59
clearly there is some point in history it knows where to start pulling commits from16:59
Guest96 joined16:59
Guest96 what is the use of -u in "git push -u origin master"17:00
jast you give the original branch as the <upstream> and the new branch with --onto17:00
Guest96: it associates the local master branch with the master branch on origin, so that "git pull" and "git push" without arguments will use that. (you can have multiple remotes, each with its own master branch)17:00
stephen no im saying, based on your comment, you say git does not know 'where/when' a branch was created17:00
so what im asking is why does rebasing work then to rewrite only the new commits ive added17:01
thiago stephen: you just remember what branches they are17:01
git won't remember for you17:01
jast rebase often defaults to the upstream branch17:01
so e.g. if you created your local branch foo from origin/foo, or you did "git push -u origin foo" at some point, the default upstream for rebase will be "origin/foo"17:01
thiago git has a feature that allows a branch locally to be configured to track another17:01
it's stored in .git/config17:01
Guest96 jast so now everytime I do git push or pull it will be done against origin, right?17:01
thiago it's not part of the repository history17:01
Guest96 do I understand it correctly?17:02
thiago so when you run "git rebase" or "git pull", it uses that information to determine which branch to rebase on top of or merge17:02
Guest96: not necessarily. That's all subject to the configuration17:03
Guest96 I don't understand it then, what's the use of -u?17:04
thiago that saves in the config17:04
geowiesnot left17:05
coaxing left17:06
john_johnk left17:06
napping stephen: If you checked out a local version of a remote branch, then git does record that in the branch.<name>.remote and branch.<name>.merge options and rebase uses it17:07
Either way, rebase figures out where exactly to look at history from by finding a common ancestor17:11
Besides, rebase usually changes where your branch is attached to the target branch17:12
coaxing joined17:13
adonis joined17:19
iomari891 left17:19
adonis is there a way to grab a list of the git tags actually being used by commits in my repo?17:20
ikke What do you mean with "used by commits"17:20
OnkelTem joined17:21
seifeslimene joined17:21
adonis I have a weird issue, where after setting an upstream on my repo the list of tags for the "upstream" got merged with the list from "origin"17:21
hitman left17:22
rewt a tag is a pointer to a commit... commits don't reference tags17:22
funhouse joined17:22
adonis at some point those got pushed so origin now has tags from both upstream and origin and I need to undo that by finding the list of tags that are actually pointing to commits in origin17:22
rewt all tags are local, so when you fetched from the remote, you fetched all the remote's tags17:22
adonis rewt: you are right, by used I meant pointing..17:22
napping Would it help to know which tags point to ancestors of some commit?17:23
Guest96 left17:23
saroy|afk joined17:25
ikke git tags --merged <branch>17:25
that should tags that are reachable from <branch>17:26
machinehum joined17:26
napping (which is maybe not helpful if your local branches are built on top of remote branches and some of the unwanted tags are in those ancestors)17:27
adonis let me try that to see what I get17:27
sandipan left17:27
sandipan joined17:32
quartz joined17:32
madewokherd joined17:34
saroy|afk left17:35
sobkas joined17:38
machinehum left17:39
machinehum joined17:41
Jacques joined17:45
v9fk1yn3nu left17:45
fling left17:47
fling joined17:48
parsnip0 joined17:50
feriman joined17:52
luke-jr joined17:53
hololeap_ left17:57
hololeap_ joined17:59
cvmn joined18:03
Jacques left18:04
quartz I'm trying to push some changes locally to a git repository on GitHub. I'm trying to do this through the terminal. I committed one file and I just want to push the changes to a specific branch of a github repository. It won't let me push the changes when I type: git push18:11
sandipan left18:12
quartz I guess it's best not to use the terminal for beginners18:12
liefer1 left18:12
liefer joined18:14
bluepenquin_ left18:16
mackerman git on the terminal is the common language on this channel, easiest to talk about in a text medium, and the most powerful.18:16
v9fk1yn3nu joined18:16
mackerman quartz: What error do you get?18:17
quartz mackerman: All I want to do is push the changes I made to a remote github repository.18:17
mackerman You will need credentials, which for GitHub means a ssh key or a personal access token.18:17
quartz I have that18:17
parsnip0 what error?18:17
jast what error do you get?18:18
quartz Actually, I'm not sure I set up the github correctly18:18
When I type git remote -v it does not show anything18:18
But on my terminal I get the green "git master" icon thing on the end of the terminal18:18
They need to offer courses on how to use git, this is crazy18:19
jast did you create the local repo from scratch using "git init", rather than as a clone from the repo on GitHub?18:19
vitali64 left18:19
quartz jast: I think I did both :(18:19
jast so, normally "git clone" sets up a remote that would show up in "git remote -v"18:19
is the github repo completely empty? i.e. not even a readme or license file or anything18:20
parsnip0 others will persevere, but you were asked for the error three times18:20
jast (the answer affects the options we have to fix up your existing local repo so that you can actually push)18:22
quartz No the github repo is not empty18:22
I did a git clone, I remember that much18:22
jast all right, do commits from the github repo show up when you do "git log"?18:22
quartz Yes18:23
jast just as an extra sanity check, what does this say: git config remote.origin.url18:23
hololeap_ left18:23
rsx left18:23
hololeap_ joined18:23
quartz jast: Nothing18:23
jast okay, that's what I expected18:24
quartz But I did a git clone18:24
jast so, apparently you cloned the github repo but, at some point, deleted the remote (by accident I'm guessing)18:24
that's not too bad, we can re-add it18:24
quartz How is that possible18:24
jast "git remote rm"18:24
parsnip0 or the clone failed? or the clone was somewhere else?18:24
jast or by editing .git/config18:24
well, if your commits show up with "git log" you've got to be in approximately the right place18:24
parsnip0 are the commits same as remote?18:24
quartz parsnip0: Uhhh I'm not sure18:25
jast we'll find out when trying to repair this :)18:25
quartz I just cloned it. I tried to make some changes on my end and I did commit one file18:25
parsnip0 k18:25
quartz Maybe I should just use the github desktop app18:25
lol18:25
jast so, let's try and re-add that remote. do you want to push via SSH (with an SSH private key) or via HTTP (username/password)?18:25
parsnip0 didn't github disable password recently?18:26
quartz Well I had to clone with a SSH private key18:26
parsnip0 like a month ago?18:26
quartz parsnip0: Yes18:26
jast no idea, I have 2FA active which disables password by itself18:26
rgrinberg joined18:26
jast okay, so let's try the SSH setup18:26
assuming your github repo is at github.com/foo/bar, do this:18:26
git remote add origin [email@hidden.address]18:26
quartz Oh shoot I lost the SSH key I generated :(18:27
God this gets worse and worse18:27
jast whoops18:27
the good news is you can add another one in the github web interface18:27
quartz Yeah I just did that18:28
jast once you have the remote re-added, "git push" should try to actually do something, and then give you a different error :)18:29
napping left18:29
jast or it might just tell you that it doesn't know where to push to, which is fine, too18:30
quartz When I make a new branch, it copies everything from master? I thought a branch could just be a few files from the main branch, or everything from the main branch18:30
EvilDMP joined18:31
jast typically a branch just starts off with the exact same contents of the commit/branch you're on at the time18:31
and they share history, so for instance the next time you commit to that branch, in a comparison of the two branches your new branch will come out as "one commit ahead"18:32
it's possible to create a completely disconnected branch, though, with no common history and no common files (unless/until you add some)18:32
it's not the most common use case, but it exists :) look at the --orphan option for "git checkout"18:33
we have manpages here for your convenience: man git-checkout18:33
gitinfo the git-checkout manpage is available at https://gitirc.eu/git-checkout.html18:33
quartz Uhhh OK18:34
Let me fix the git remote add thing now18:34
jast: OK I just added the repo, and git remote -v returns the repo name18:36
tyson2 left18:38
Sulky joined18:41
hitman joined18:43
hitman left18:44
quartz I'm trying to swtich to a branch on my local git repo. I'm doing git checkout <branch name> but it's telling me: error: pathspec 'indent-feature' did not match any file(s) known to git18:45
parsnip0 will that be a new branch name, or one existing already on remote?18:46
quartz parsnip0: I just created the branch via the github web interface on the repo18:47
So maybe my local repo needs to be updated somehow?18:47
parsnip0 maybe try `git fetch`?18:47
quartz What will that do18:47
liefer5 joined18:48
quartz nevermind I'll look it up, sorry dumb question18:48
parsnip0 fetch branch refs from remote18:48
it's sort of half of "git pull"18:48
git pull is approximately git fetch + git merge18:48
basically, search term could be like, "how do i checkout a remote branch"18:49
*git18:49
but connecting the random claims on internet to actual information found in git manual or book is a good practice18:50
liefer5 left18:50
parsnip0 i try to prefer the git manual and git book, but if i use external results, i try to confirm somewhere in manual18:50
liefer left18:50
parsnip0 it also gets you used to how things are described in manual18:51
duxsco joined18:52
liefer joined18:52
fling left18:52
quartz When I do git fetch it says: fatal: protocol 'git@https' is not supported18:53
ikke quartz: sounds like a messed up remote url18:53
fling joined18:54
liefer2 joined18:54
quartz Maybe I don't need the https18:55
ikke not if you use ssh18:56
which you seem to be using18:56
parsnip0 yep, above was said, "git remote add origin [email@hidden.address]18:56
[email@hidden.address]18:56
liefer left18:57
liefer2liefer18:57
quartz parsnip0: When I do that (without the https) it tells me: origin already exists :(18:57
Why does nothing work right fo rme lol :(18:58
dslegends joined18:58
ikke git remote set-url origin <new-url>18:58
parsnip0 i only meant that you weren't advised to put https18:58
coaxing left18:59
quartz ikke: now it says "does not appear to be a git repository18:59
I didn't add https18:59
in the url name18:59
liefer left19:00
quartz Maybe because the repo is private? I have access rights under my account.19:00
Payam left19:00
parsnip0 maybe it has to be [email@hidden.address] ?19:01
https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories#changing-a-remote-repositorys-url19:01
liefer joined19:01
ikke parsnip0: git is smart enough to append it if necesary19:01
parsnip0 ah19:01
coaxing joined19:02
gildasio left19:02
gildasio joined19:04
mjoerg joined19:04
parsnip0 ikke: perhaps they could test `ssh -T [email@hidden.address] per https://docs.github.com/en/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection19:04
ikke that should show the user they are authenticated as19:05
quartz It has nothing to do with the fact that it's a private repo?19:05
ikke quartz: perhaps19:05
mjoerg left19:06
ikke quartz: how many user accounts do you have?19:06
quartz ikke: One19:06
great_taste left19:06
great_taste joined19:06
LuxuryMode joined19:06
ikke Ok, so I expect that account to have access to that repo19:06
parsnip0 what command provoked "does not appear to be a git repository"19:07
quartz git fetch19:07
ikke quartz: can you try what parsnip suggested19:07
parsnip0 `ssh -T [email@hidden.address]19:07
ikke ssh -T [email@hidden.address]19:07
quartz The authenticity of host 'github.com (140.82.112.3)' can't be established.19:08
How is that possible, it's a very established site19:08
ikke That's normal for ssh when you connect the first time19:08
quartz [email@hidden.address] Permission denied (publickey).19:09
ikke Did you generate an ssh keypair and added the public key to github?19:09
cousteau joined19:09
ikke And this also suggests the remote url is still incorrect19:09
quartz ikke: No idea what tha tis19:09
Holy shit it's taken me an entire day to learn how to push a simple file to a github repo lol19:10
ikke https://docs.github.com/en/authentication/connecting-to-github-with-ssh19:10
quartz Maybe it's better to do it from https?19:10
Or does that mean I can't connect via terminal?19:10
ikke You need to generate a personal access token19:10
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token19:11
quartz ikke: Yes I have one19:11
parsnip0 you mean that's an alternative19:11
ssh, or token19:11
ikke quartz: then use https and use that token19:11
Misotauros joined19:12
ikke and copy the url from the project page (there is a green "19:12
quartz Oh I thought the token method was ssh19:12
ikke "code" button)19:12
parsnip0 iiuc, ssh and token are disjoint methods19:12
and github removed password access a month ago19:12
ikke ssh uses a key pair19:12
parsnip0 we all using ssh key pair19:12
mackerman "ssh key" is ssh. "personal access token" is generated passwords over https.19:13
EvilDMP left19:13
funhouse left19:13
ikke What github changed is that you cannot use your password anymore, but need to use a access token19:13
quartz omg you guys it worked19:13
parsnip0 congrats!19:13
EvilDMP joined19:13
parsnip0 you are welcome to use GitHub Desktop app, but this channel wouldn't be able to help as much.19:14
as was said earlier, CLI git is the common denominator19:14
quartz Yeah I needed the .git at the end of the url for some reason19:14
parsnip0 maybe19:15
i'm skeptical, based on what ikke said. maybe multiple things changed.19:15
i've leaned heavily on magit as a git UI, which hinders my ability to keep up on this channel.19:15
quartz OK now I can git checkout <branch name>19:16
coaxing left19:19
quartz I made changes to one file on my local repo, but I want to push them to a remote repo. When I type 'git push origin <branch name>' it says "everything up to date" but how is that possible?19:19
hololeap joined19:19
ikke quartz: you need to commit the change first19:19
hololeap_ left19:20
coaxing joined19:20
quartz ikke: Yes I just did that.19:20
coaxing left19:21
ikke what does git status say?19:21
quartz It still tells me "everything up to date19:21
coaxing joined19:21
quartz Your branch is up to date with 'origin/indent-feature'.19:21
Nothing to commit working tree clean19:22
ikke did you commit before or after you checked out the branch?19:22
parsnip0 maybe the change is already there19:22
ah19:22
quartz I think before19:22
ikke then it's committed in the previous branch (probably master?)19:22
parsnip0 git log --oneline --graph --all --pretty=format:"%h"19:23
quartz: can you share result of above in a pastebin site?19:24
hmm, no decorate19:24
ikke !situation19:24
gitinfo Please post the url returned by ' git log -n 20 --all --graph --format="%h %p %d %s" | curl -F text=@- https://upaste.de ' to give us an idea about what your situation is (increase the -n argument if your problem is more complex than 20 commits can explain)19:24
parsnip0 change "%h" to "%h%d"19:25
quartz ikke: I tried to commit it on the branch I'm on now19:25
parsnip0 if you don't want to share commit messages, remote %s19:25
oh, --oneline is redundantj19:26
s/j//19:26
*remove %s19:26
quartz https://upaste.de/ppQ19:26
funhouse joined19:27
parsnip0 that makes things clearer, no?19:27
ikke is 945d282 your commit?19:27
git show 945d28219:27
quartz parsnip0: I'm honestly not really sur ehow to read it19:27
ikke: I'm not sure19:27
ikke run that command19:28
parsnip0 quartz: run it with %s locally, it might help you interpret19:28
epony joined19:28
parsnip0 but we can pretty much read it without the %s19:28
run `git show 945d282` as suggested, might confirm if that was the file changes you were looking for19:29
quartz yes they are19:29
but I don't see it reflected on the repo when I look at the files via the web on github19:30
ikke git cherry-pick 945d28219:30
parsnip0 conceptually, i think you want to move the indent-feature "branch ref" over to where master is right now19:30
ikke git branch -f master origin/main19:30
quartz branch 'master' set up to track 'origin/main'.19:31
ikke quartz: what does git status say now?19:31
quartz Your branch is up to date with 'origin/indent-feature'19:32
Uhh19:32
I think I'm exhausted from this lol19:32
ikke quartz: you forgot the cherry-pick?19:32
quartz what does that do19:33
ikke copy the commit onto the current branch19:33
quartz Oh19:33
liefer2 joined19:33
quartz Yeah OK I just did that19:33
Git terminal now has an up arrow and 1 on it19:33
ikke now you can push your branch19:33
quartz Which means it's waiting for me to push the commit?19:33
ikke I suggest you to read the first couple of chapters of https://git-scm.com/book/en/v219:34
anddam should tags be auto-completed when typing "tags/" then startin a tag name?19:35
quartz ikke: Yes someone suggested it in here earlier.19:35
anddam I do have bash-completion for git enabled19:35
quartz So now I have to do: git push origin indent-feature?19:35
ikke quartz: yes19:35
parsnip0 ikke: https://gitexercises.fracz.com/ is another good resource?19:35
ikke probably19:36
parsnip0 quartz: interactive exercises ^ (maybe after reading those chapters mentioned)19:36
hololeap_ joined19:37
quartz parsnip0: Wow thanks so much :)19:38
parsnip0 :-)19:38
quartz Yeah interactive exercises helped me learn vim19:38
tyson2 joined19:38
quartz OK thanks everyone for your help, I could have not done this by googling my way thorugh it19:38
hololeap left19:38
liefer left19:38
liefer2liefer19:38
ikke 80% of using git is getting learning a specific workflow19:39
quartz Yeah I'm trying to work exclusively from terminal19:39
ikke That's fine19:39
quartz I mean, how else would you interact with git? the desktop app?19:39
ikke yeah, there are all kinds of interfaces19:39
dedicated tools or integrated into editors19:39
parsnip0 quartz: there's a link in the /topic, that leads to https://gitolite.com/gcs.html and https://jwiegley.github.io/git-from-the-bottom-up/19:40
ikke But personally using the CLI is the best way to learn git19:40
parsnip0 in a sense, it's got the best support19:40
ikke :)19:40
liefer left19:40
parsnip0 i generally don't ask questions about magit here ;-)19:41
Jong joined19:41
ikke I happen to use it19:41
liefer joined19:41
quartz OK thanks everyone for your help, I need to go and eat now.19:41
magic_ninja joined19:41
quartz left19:42
Gustavo6046 left19:43
Gustavo6046 joined19:43
Akiva left19:43
hololeap_ left19:43
hololeap_ joined19:45
dionysus69 left19:47
EvilDMP left19:49
seifeslimene left19:49
great_taste left19:49
stephen left19:49
CATS joined19:49
seifeslimene joined19:50
fling left19:56
fling joined19:58
pulse left20:01
great_taste joined20:01
skapata left20:01
EvilDMP joined20:01
geowiesnot joined20:02
sobkas left20:03
Flooo joined20:06
Flooo Hi20:06
I have a problem with my submodule. I changed the commit but it seems the top level repository is not seeing it20:08
git status does not show it as modified and git add does not work too20:08
EvilDMP left20:08
Flooo how can i solve this?20:08
gh34 left20:09
geowiesnot left20:09
pulse joined20:09
Guest69 High level question: I never know how granular to make my commits. Typically I'll end up with a few hundred lines of diffs across a half-dozen files, many of which are not logically related.20:11
nedbat Guest69: make them more granular than that :)20:11
Guest69 for example: I fixed a logging issue, fixed a formatting issue, edited some comments, fixed a bug and added a feature which is kinda related to the bug and kinda not... do I commit these all as one big blob, or try to take the time and commit these 5-ish things one at a time?20:11
duxsco left20:12
nedbat Guest69: i would separate them into 5 commits20:12
(i would try to)20:12
Guest69 okay and each commit is like 20-70 lines of diffs probably20:12
nedbat 20-70 sounds like a good size20:13
xylz joined20:13
Sulky left20:13
iffraff joined20:14
Flooo Guest69: i would make minimum 5 commits, maybe more depending if the are woth to split up20:14
Sh4dowmonk joined20:14
Flooo But of course you should not need more time to split up the stuff than doing the actual change ;-)20:16
zer0bitz left20:16
Flooo Solved my problem with not recognized submodule change by switching branches of top-level repo20:18
Lord_of_Life_ joined20:18
feriman left20:19
cliluw joined20:20
Lord_of_Life_Lord_of_Life20:21
EvilDMP joined20:21
a1eaiactaest joined20:23
dionysus69 joined20:28
Sh4dowmonk left20:28
avalon Guest69: think of it from the point of view of the person that might have to review your commits. you want them to be relatively self contained and digestible - nobody wants to review several hundred lines of diffs that touch a bunch of different areas of the code base in unrelated ways20:30
adonis left20:31
cliluw left20:35
awmv joined20:36
t0mm13b_ joined20:38
zumba_addict joined20:39
anddam can I remove all stale branches at once?20:39
anaveragehuman joined20:40
anddam to be more clear I want to delete local branches whose remote counterparts are gone20:40
and I am on windows so my scripting capabilities are severely capped20:40
Sh4dowmonk joined20:41
Sh4dowmonk left20:42
anaveragehuman left20:47
gas51627 left20:48
mackerman anddam: git remote prune20:49
szkl joined20:57
donofrio left20:58
lgc joined20:59
zeenk joined21:00
fling left21:00
lgc left21:00
xylz left21:01
fling joined21:02
anddam nope, that will keep the local branches, but git branch -vv will show "gone" for the remotes21:04
well I ended up doing it by hand, it was easier anyway21:05
but I am curious if there's a syntax for that, or that is left as an exercise to the reader21:05
donofrio joined21:06
madewokherd left21:06
kexec joined21:06
kenanmarasli left21:07
Xenguy left21:07
dionysus69 left21:08
pretty_dumm_guy joined21:08
bertvvvs left21:09
kexec if i create a commit with --date and then push it, git log shows the entered date,, but github shows the date and time when the commit was actually created (not the date and time i entered through --date)... why is that? or to force the entered date to show on github?21:10
foo Does "github" or "gitlab" handle git merging differently? We recently had an issue where (to my surprise) a git merge did not properly show 5 lines as being an addition... which broke some stuff and caused some confusion. One of our devs blamed the fact that it's because we're not using github or gitlab and that those two "merge more intelligently" ... I believe "git is git" ... there are no "smarter ways of21:13
merging" - can anyone speak to this? I'm open to his thoughts, I simply didn't realize if that was the case.21:13
ljharb afaik github just uses git21:14
but also, you're not using github or gitlab? O.o21:14
foo smacks ljharb21:15
foo ljharb: No. :) gitolite21:15
I'd imagine they all use git ... but maybe not21:15
ljharb even tho the dev is wrong, the thing they want is good :-p21:16
cousteau foo: there's a difference between what git does when merging and what it shows you21:18
once you've merged, all git knows is: what are the two parent commits, what the code looked like in those commits, and what the code looks like now.21:18
if you use a tool to visualize the diff, it will GENERATE the diff when you request to visualize it. Git does not store this diff anywhere; it stores complete snapshots of the code.21:19
So... maybe Github is displaying things differently.21:19
Akiva joined21:20
cousteau ...wait, did you mean "show 5 lines as being a deletion" as in really "show", or as in "understand"? Because I think I misunderstood what you meant.21:20
if this is about how git *merges* rather than how it displays the merges, then... well, github definitely or most likely uses git for merges, but it might tweak the default options21:21
like, instead of defaulting to strategy X, it defaults to strategy Y, which is smarter about whatever21:21
foo cousteau: first of all, I appreciate your willingness to make sense of what I'm saying - thank you. For clarity, we use gitolite, with git. I did a git merge feature-branch. I fixed two conflicts. Then I did git diff --cached ... and I could clearly see that git was not showing me 5 lines - this is the first time I've ever seen this. What that meant is: we had 5 lines in there that should have been removed (it21:22
was moved down in the code)21:22
cousteau Or, you have an old version of git, and it isn't as smart about merges. Git very recently introduced a new merging strategy that is now the default; maybe that is smarter in some regards21:22
foo Ohhhhh21:23
cousteau oh. Well, git diff doesn't show everything on a merge, be careful with that.21:23
foo cousteau: I wonder, if that's a version of gitolite or local git21:23
cousteau: I believe git diff (CLI) only shows modifications?21:23
j416 foo: with arguments it can diff other things than the work tree21:24
cousteau if you have two commits, it'll show differences directly. But with merges involved, things get funky21:24
wakeup joined21:24
cousteau I'd give you details if I understood 10% of it...21:24
foo lol21:25
Fair enough21:25
j416 haha.21:26
cvmn left21:26
foo Can someone verify if github or gitbucket merges differently? My sense is, the developer was referring to the UI on merging21:26
j416 I've been using git almost daily for over a decade and still haven't made much sense of the merge diffs21:26
foo haha, fair enough.21:27
j416 (but I'm sure they make some sense, if you try)21:29
cousteau I think merge diffs only show the stuff that isn't in either of the ancestors21:29
...kinda21:29
or that is in one of the ancestors when it should be in the other21:29
i.e. only shows what you changed over a regular git merge21:30
foo I wonder if a loom (screen recording) would help get my point across.21:30
I've never seen this before21:30
cousteau anyway. I assume gitolite has a GUI with a cool "Merge these two branches!" button that does all the work, right?21:31
foo cousteau: nah, no UI21:31
cousteau Maybe that button doesn't do the same thing as `git merge`, but rather `git merge --strategy=whatever --strategy-option=dunno`21:31
oh21:31
...then what the hell is gitolite?21:32
foo cousteau: let's me specify perms to branches, https://gitolite.com/gitolite/index.html - , let's me set up git hosting for a couple projects21:32
cousteau I see21:32
but I suppose gitolite itself doesn't merge, right? It just hosts a git repository, and if you want to merge you pull, merge, and push21:33
(and if you try to push to a forbidden branch, then you get a paddlin')21:33
because in that case it's your local git what's doing the merging, not gitolite21:34
Flooo left21:34
madewokherd joined21:34
Gustavo6046 left21:34
cousteau if it were something like github, I suppose it can "do some magic" when you merge through it. I can imagine that github may not do a "plain, option-less merge" when merging two branches through the GUI21:35
hololeap_ left21:36
adonis joined21:36
john_johnk joined21:37
hololeap_ joined21:37
adonis whats the official way to deal with 'env: python: No such file or directory' when doing git commit on mac os 12.3. Mac os 12.3 removed python 2.7 which it seemed the git binary was using?21:37
Akiva left21:38
zeenk left21:39
cousteau ...install python again?21:39
cousteau wonders if it HAS to be 2.7 or if python 3 will work just fine. After all, 2.7 is probably deprecated by now.21:40
cousteau actually don't pay much attention to me since I have no idea what the "official" fix is. (But you do have an up-to-date git, right?)21:41
adonis I have git updated to the latest yes21:41
but I wonder if I can somehow get env to pickup python3 which I do have.21:42
john_johnk left21:42
cousteau normally, python would link to python2 or python321:42
but it's weird that nowadays there are still `#!/usr/bin/env python` scripts that don't specify either python2 or python3 explicitly21:43
adonis I tried doing alias python='python3' or even the absolute path to it but env still complains21:43
cousteau as far as I know, env won't get aliases21:44
you'd need a symlink21:44
w_lehinsun joined21:44
cousteau doesn't have to be in /usr/bin (or whatever Mac uses); could be local, anywhere on the $PATH21:44
adonis right now python doesn't link to python3 on mac os 12.3 so yea let me try linking on those dirs you mentioned.21:44
cousteau be careful though, because if a script is in python2, calling it with python3 might fail21:45
great_taste left21:45
adgtl left21:46
a1eaiactaest left21:46
adonis cousteau: good point. its better if I link python to python 2.7.x21:47
cousteau if you still have it, yes, definitely do link it to whichever version it was before21:47
...can't see any python script in git though21:47
MajorBiscuit joined21:48
cousteau (I recall that there were some python scripts, e.g. git-p4, but I can't find any on core git using python, on a quick and dirty and probably incomplete search)21:48
adonis cousteau: when I open the git binary for editing/inspecting I do see references to python in there though21:49
cousteau oh21:50
...well, I guess it's calling python with a script that is stored *somewhere else*21:50
do you see how it's calling python? what script it's passing it?21:50
adonis nah, it’s a binary file :)21:50
john_johnk joined21:51
adonis that’s a machine executable file, not sure what the proper term would be :)21:51
cousteau yeah, I got that... I thought you were inspecting the binary and somehow found "python" in it21:51
adonis that’s what I pretty much did lol, theres a bunch of chars that can't be read but yea, python is referenced21:52
cousteau I see that the git source code has makefiles that try to figure out where is python installed; maybe the officialest solution for your case is "just recompile git"?21:53
namely, the Makefile file has a PYTHON_PATH that defaults to /usr/bin/python.21:55
adonis cousteau: the makefiles having those references wouldn't tie into to python being in the binary though right?21:56
cousteau only .py file I see in the source code is git-p4.py, and it seems to be compatible with both python2 and python3... so I suspect you're safe with whatever version of python you have21:57
great_taste joined21:57
cousteau adonis: I think those references on the makefile determine how the binary will be compiled, so it'll eventually have a reference to that specific path21:58
...then again... that defines a path, so it doesn't use env. Your problem said something about env not finding python.21:58
adonis pretty much21:58
specifically calling git commit -m "message", gives 'env: python: No such file or directory'22:00
git add is ok22:00
MajorBiscuit left22:01
madewokherd left22:03
awmv left22:03
fling left22:04
fling joined22:06
Murr left22:07
Akiva joined22:07
Murr joined22:07
adonis cousteau: how do I get env to pickup the path I specify for python? I tried doing env python=<python3 path here> git commit -m "test" but it won't pick it up.22:10
env is picking the value up but git won't pick it up from env22:11
cousteau env python=... will only run the command with a $python environment variable22:14
adonis oh22:14
cousteau not set the path to `python`22:15
you have to put a `python` executable in one of the directories listed in your $PATH22:15
ramblebamble joined22:15
cousteau for example, ``ln -s /usr/bin/python3 /usr/local/bin/python`` (assuming /usr/local/bin/python does not exist yet)22:16
or mkdir /tmp/python-path; ln -s /usr/bin/python3 /tmp/python-path/python; env PATH="/tmp/python-path:$PATH" git commit...22:17
ramblebamble Hi there, got a quick question, I know that notes are not pushed upstream, and for my situation tags are a bit heavy weight, is there a way to mark commits residing on disjunct branches as leading to the same worktree structure?22:17
adonis yea I did that lol but wanted to not have to do that as python will now be linked to running python322:17
cousteau adonis: and let me see if there is some obscure env variable for setting git's python22:17
impermanence joined22:18
another| ramblebamble: lightweight tags?22:19
ramblebamble another|, no... I actually ment tags of any kind22:20
another| how are leightweight tags too heavy?22:21
cousteau forty-one whole bytes, man...22:22
ramblebamble I do not mean the byte-size, but the implications, tags are usually used to denote deployments, etc. I was hoping for something more distinct, or being able to tie to commits together in that regard22:24
another| yeah, gotta do a lot of jogging to counter those22:24
tyson2 left22:24
ramblebamble a bit more context22:24
tyson2 joined22:24
another| annotated tags are usually for releases. lightweight tags for your own remarks22:25
ramblebamble I am currently thinking on orphaned checkouts, and how you might want to use one branch to serve your private repository and the other to serve e.g. heroku for deployment. You cherry pick the changes you want to deploy, maybe even rebase(but I am reading up on that as we speak). In any case, I require a way to symbolize that commit abc in branch a yields the same working tree as commit cbd on branch22:26
j.22:26
jazzy joined22:27
ramblebamble While your description of tag-usage is correct, it is not always followed, e.g. CI/CD starts running on any tag it encounteres etc.22:27
tmz joined22:27
john_johnk left22:28
john_johnk joined22:31
EvilDMP left22:33
another| what would be the point of the separate branch?22:34
analpaper_ joined22:34
ramblebamble disjunct history over a common codebase/project22:35
cebor joined22:35
ramblebamble e.g. with Heroku or the AUR repository of Arch Linux you have a repository where you push to once you want to deploy, but then again you also have a remote where you want to develop22:35
it allows you to publish only the bare minimum changeset, not show how the sausage is made so to speak in the remote used for publishing22:36
but retain the information in the remote you use for development22:36
analpaper left22:37
ramblebamble to enable this seemlessly tying commits together in the described way would be nice22:37
junktext left22:39
stef204 left22:42
another| id doesn't sound like you want disjunct history then. wouldn't simple feature branches serve that use case?22:43
parsnip left22:44
ramblebamble no, if I want to retain information by keep other things private, I cannot rebase and ommit some commit-messages etc. that will cause trouble rebasing etc. and keeping those feature-branches open all the time. dedicated repos would be best, but that is also cumbersome in its own way, hence my idea with the orphaned branches22:45
impermanence left22:46
john_johnk left22:47
john_johnk joined22:49
cousteau adonis: does your repository have any hooks that may be calling python?22:51
because otherwise it seems strange that python is being invoked, unless I'm missing something (as a normal git user who is not a git developer/maintainer or anything)22:52
dtux_ joined22:53
walterwhip joined22:54
john_johnk left22:55
dtux_dtux22:57
hololeap_ left22:57
hololeap_ joined22:57
walterwhip left22:58
geowiesnot joined23:00
adonis cousteau: you got it.. that’s the issue. there's a pre commit hook that ends up calling a python script23:00
madewokherd joined23:03
pizdets joined23:04
adonis cousteau: heres the script: github.com/hallettj/git-format-staged/releases/tag/v3.0.0 and what do you see for version 3.0.0? A fix to use python3, nice..23:04
dvanloon7 joined23:09
dvanloon7dvanloon23:09
sa0 left23:09
Akiva left23:10
cousteau ah, cool :)23:10
honestly I have no idea how I guessed that23:10
sa0 joined23:11
sa0 left23:15
parsnip joined23:15
Akiva joined23:27
bertvvvs joined23:31
gurkenglas left23:32
kexec left23:33
DNH left23:36
TheCatBehemoth joined23:41
ramblebamble ok just to wrap things up, another|, apparently there isn't a way at least non that I could see. Then lightweight tags it is with changes on the CI/CD side. thanks for th support and ear. 'till next time23:44
TheCatBehemoth left23:45
wakeup left23:46
rgrinberg left23:47
ramblebamble left23:47
skapata joined23:53
skapata left23:53
skapata joined23:53

Logs Search ←Prev date Next date→ Channels Documentation