IRCloggy #git 2020-09-12

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.

2020-09-12

mat001 joined00:00
mat001_ left00:03
INeedAHandle left00:05
dionysus69 left00:07
arcatech joined00:08
Lucas_Gray left00:08
maxwilliamson left00:08
jimklimov left00:08
maxwilliamson joined00:08
qqx left00:09
puff Is there a way I can grep one particular file in all of the commits? Ideally one *part* of a particular file, but I can't iamgine any way to do that that makes sense, short of a language parser.00:09
mi12078 left00:10
qqx joined00:11
goldmund left00:12
mi12078 joined00:13
tiin57 left00:15
RoboFlex12 joined00:16
mat001_ joined00:18
tiin57 joined00:19
SwiftMatt joined00:21
mat001 left00:21
Hello71 man git-grep00:21
gitinfo the git-grep manpage is available at https://gitirc.eu/git-grep.html00:21
Hello71 but probably this is !xy and you actually want git blame or git log -S/-G or somesuch00:22
gitinfo You are asking about a solution, but we can help you a lot better if you could describe the actual problem you are trying to solve.00:22
gordonfish joined00:27
R2robot joined00:29
qpdbGuest3255400:38
Guest32554 left00:38
qpdb joined00:38
mjh4386 left00:43
tiin57 left00:45
leeN left00:45
mat001 joined00:47
tiin57 joined00:48
mat001_ left00:49
RaceCondition left00:58
SwiftMatt left00:58
goldmund joined01:01
gschanuel joined01:02
mat001_ joined01:02
shicks2525 left01:02
goldmund left01:03
qpdb left01:04
shicks2525 joined01:05
mat001 left01:05
mud joined01:15
tiin57 left01:15
tiin57 joined01:18
rafasc left01:20
mat001 joined01:25
stats4647 joined01:25
mat001_ left01:27
F0rTex left01:30
F0rTex joined01:32
steven left01:33
nvmd left01:34
sstutz joined01:35
dionysus69 joined01:39
mat001_ joined01:43
apetresc left01:45
tiin57 left01:45
mat001 left01:47
stats4647 Hi, could someone pls clarify what the following message means? TIA. I did a git pull followed by git log --oneline01:49
e78fae (HEAD -> master, origin/master, origin/HEAD) chore: Merge branch 'master' of github.com:path/to/project into master01:49
to1ne left01:49
tiin57 joined01:49
apetresc joined01:50
dfee left01:54
akemhp_ joined01:56
akemhp_ left01:56
akemhp left01:58
mat001_ left01:59
Xenguy joined02:04
stats4647 However, when I do, git status, I get "Your branch is up to date with 'origin/master'." so why do I need to merge anything?02:04
Jookia stats4647: did you merge it?02:05
stats4647 Jookia: not explicitly, I thought git pull does fetch and merge (two-in-one), but I could be wrong02:06
Cabanossi left02:06
Gurkenglas left02:07
Jookia stats4647: if you do 'git log' are you the comitter of the merge?02:07
stats4647 Jookia: no, the author of the merge is someone else02:09
Jookia stats4647: so you've just pulled the latest commit and not merged anything02:09
Cabanoss- joined02:10
to1ne joined02:10
stats4647 Jookia: thanks, does that mean I have two branches that need merging? And if so, then why do I get this message on git status02:11
On branch master02:11
Your branch is up to date with 'origin/master'.02:11
Jookia nothing needs merging, your branch is identical to origin/master02:11
mjh4386 joined02:12
stats4647 Jookia: ok, but then what does this message mean ( from my original question )02:12
e78fae (HEAD -> master, origin/master, origin/HEAD) chore: Merge branch 'master' of github.com:path/to/project into master02:12
mjh4386 left02:13
stats4647 Jookia: ah, never mind, it's just a message the other merger put in?02:13
mjh4386 joined02:13
Jookia stats4647: that shows that your HEAD, your master branch, origin's master branch, and origin's HEAD are all at e78fae, which happens to be a merge commit someone did02:13
tiin57 left02:15
stats4647 Jookia: I see, thank you. To confirm, HEAD -> master just means the HEAD points to the last commit on master?02:18
lagothrix left02:18
lagothrix joined02:18
tiin57 joined02:18
Jookia yes. master points to commit e78fae which is the 'last commit'02:19
hexnewbie left02:20
stats4647 thank you02:21
hexnewbie joined02:21
sunrunner20 joined02:23
anddam joined02:24
mirrorbird left02:29
sunrunner20 left02:35
sunrunner20 joined02:36
arcatech left02:39
Aki-lucky left02:45
tiin57 left02:45
sunrunner20 left02:46
sunrunner20 joined02:48
apetresc left02:48
davispuh left02:48
dionysus69 left02:49
tiin57 joined02:49
sunrunner20_ joined02:51
apetresc joined02:52
sunrunner20 left02:53
sunrunner20_sunrunner2002:53
mowcat joined02:56
RoboFlex12 left03:03
mowcat left03:04
Goplat joined03:06
jwest left03:09
tiin57 left03:15
g00s left03:17
tiin57 joined03:18
dfee joined03:21
Muimi joined03:23
mirrorbird joined03:26
duderono_ left03:32
sudoforge left03:37
tiin57 left03:45
dfee left03:46
justanotheruser left03:46
tiin57 joined03:49
ricks_ joined03:50
darkstardev13 joined03:52
cd left03:52
cbreak left03:53
cbreak joined03:54
mjh4386 left04:04
holdsworth joined04:06
c0san0stra joined04:08
darkstardev13 left04:10
crose left04:12
tiin57 left04:15
arcatech joined04:18
tiin57 joined04:19
fledgling joined04:26
mindCrime_ left04:34
govg left04:34
duderonomy joined04:35
stats4647 left04:36
mindCrime_ joined04:37
stats4647 joined04:38
matelot joined04:39
stats4647 left04:43
tiin57 left04:45
Cabanoss- left04:48
arcatech left04:49
tiin57 joined04:49
heyitsrama joined04:49
gschanuel left04:50
gschanuel joined04:51
Cabanossi joined04:55
stats4647 joined04:56
dfee joined04:57
gschanuel left04:59
gschanuel joined05:00
gschanuel left05:00
gschanuel joined05:00
natechan joined05:01
gschanuel left05:01
gast0n left05:02
bket left05:06
YuGiOhJCJ left05:06
g00s joined05:07
heyitsrama left05:07
ricks_ left05:09
RoriconKnight joined05:09
astronavt left05:12
bket joined05:13
cbreak left05:15
tiin57 left05:15
cbreak joined05:15
tiin57 joined05:18
stats4647 left05:23
ricks_ joined05:23
ricks_ left05:33
th_ left05:36
feriman joined05:41
vicfred left05:42
tiin57 left05:45
raven-au left05:48
tiin57 joined05:49
to1ne left05:52
tsujp joined06:01
causasui left06:05
stats4647 joined06:05
blahboybaz left06:05
tiin57 left06:15
tiin57 joined06:18
raven-au joined06:19
ADG1089 joined06:21
stats4647 left06:22
Jookia left06:23
sudoforge joined06:25
Jookia joined06:25
thiago left06:34
FH_thecat left06:35
tarkus joined06:37
fledgling left06:38
Ransu joined06:41
ShapeShifter499 left06:43
nabil_ left06:45
nabil_ joined06:45
tiin57 left06:45
nabil__ joined06:47
tiin57 joined06:49
nabil_ left06:50
ransu__ joined06:50
Ransu left06:53
unluckyshrubbery left07:02
hussam left07:12
feriman left07:15
tiin57 left07:15
irimi1 left07:17
tiin57 joined07:19
to1ne joined07:21
pikapika left07:22
pikapika joined07:22
clara97 left07:24
eamanu left07:24
irc_user left07:24
timwis left07:24
eamanu joined07:24
nabil_ joined07:24
n000g left07:24
afisher left07:24
jhill left07:24
rustyshackleford left07:24
ignapk left07:24
nilsirl[m] left07:25
KnownSyntax left07:25
ignapk joined07:25
omnidapps left07:25
dmlloyd left07:25
nilsirl[m] joined07:26
Chaser left07:26
carlesc left07:26
rustyshackleford joined07:26
clara97 joined07:26
austin987 left07:27
jhill joined07:27
nabil__ left07:27
afisher joined07:27
n000g joined07:27
zalun left07:28
omnidapps joined07:28
KnownSyntax joined07:28
dmlloyd joined07:29
felixsanz left07:30
gitter1234 joined07:30
DNS777 joined07:30
carlesc joined07:30
nabil__ joined07:30
DNS left07:30
zalun joined07:31
Chaser joined07:31
Flynn1110 joined07:31
nabil_ left07:33
felixsanz joined07:38
sgn left07:38
sm[m] left07:39
nabil__ left07:40
g00s left07:41
timwis joined07:41
mindCrime_ left07:42
akemhp joined07:43
tiin57 left07:45
tiin57 joined07:48
sm[m] joined07:49
blaisebool left08:00
Gustavo6046 left08:11
Goplat left08:12
yonder left08:14
mindCrime_ joined08:15
tiin57 left08:15
govg joined08:18
stats4647 joined08:19
tiin57 joined08:19
mjh4386 joined08:20
sphalerite left08:23
stats4647 left08:24
fingercomp left08:26
mindCrime_ left08:26
mjh4386 left08:26
calcul0n joined08:26
fingercomp joined08:27
unluckyshrubbery joined08:27
th_ joined08:28
govg left08:28
sphalerite joined08:29
govg joined08:29
Shantara joined08:42
tiin57 left08:45
Newami joined08:46
tiin57 joined08:49
Newami left08:50
ADG1089 left08:50
sudoforge left08:53
n000g left09:03
hussam joined09:04
n000g joined09:04
milkt_ joined09:08
milkt left09:09
Guest20 joined09:10
matelot left09:13
feriman joined09:14
cbreak left09:15
tiin57 left09:15
cbreak joined09:16
tiin57 joined09:18
Betal left09:24
jaziz left09:38
leeN joined09:43
vdamewood joined09:44
Borkr joined09:45
tiin57 left09:45
Guest20 left09:46
tiin57 joined09:49
feriman left09:54
feriman joined10:00
Guest20 joined10:12
tiin57 left10:15
royal_screwup21 joined10:15
milkt_ left10:16
milkt joined10:16
benfelin joined10:17
benfelin left10:17
Flynn1110 left10:18
tiin57 joined10:19
RaceCondition joined10:27
Olipro joined10:30
Shantara left10:32
Guest20 left10:33
palooka_jock left10:36
currybullen joined10:38
Borkr left10:40
royal_screwup21 left10:41
palooka-jock joined10:41
currybullen is there any shorter way of finding all files named .classpath in the index than something like "git ls-files .classpath '**/.classpath'"?10:41
royal_screwup21 joined10:41
osse Does this count? git ls-files {,'**/'}.classpath10:43
It is a bit annoying that **/ doesn't look in the current dir10:44
tiin57 left10:45
currybullen i can't understand why it doesn't do that. if i put **/.classpath in my .gitignore it will also ignore .classpath in the root directory10:47
Hello71 left10:47
currybullen but searching for .classpath files using my above git ls-files command it will ignore a .classpath file in the root dir10:48
tiin57 joined10:49
osse it also goes against the meaning of **/ in bash and zsh10:49
Hello71 joined10:49
currybullen yes, the expansion of **/.classpath in bash will include .classpath in the root dir10:51
osse honestly I'm often a bad bad boy and do g ls-files | grep classp10:53
unless I am scripting10:53
stats4647 joined10:59
stats4647 left11:03
tiin57 left11:15
Jackneill hey. anyone encountered a problem where to a private repo you can successfully push to gitlab but not github? (insteadOf ssh url set, priv key's pub key added to github, etc..)11:15
feriman left11:15
Jackneill any idea? (github chan does not help)11:15
tiin57 joined11:18
gitter1234 left11:19
DarwinSurvivor joined11:29
DarwinSurvivor left11:30
tiin57 left11:45
tiin57 joined11:49
bruce_lee joined11:51
gitter1234 joined11:54
royal_screwup21 left11:55
royal_screwup21 joined11:56
bolovanos_ joined11:58
royal_screwup21 left12:00
to1ne left12:09
sgn joined12:09
cdown left12:12
cdown joined12:13
tiin57 left12:15
j416 Jackneill: more details would help12:18
tiin57 joined12:18
Jackneill j416, i have the same pub key set for both gitlab and github personal account. when the origin url is git@gitlab:... it works, when its git@github:... it does not.12:19
osse Jackneill: faulty .ssh/config ?12:20
Jackneill in the github chan i only got that it does not find the ssh key, but it does because gitlab works12:20
royal_screwup21 joined12:22
Jackneill osse, i have set the insteadOf https://github.com use [email@hidden.address] and also the sshCommand to use the locally provided .ssh folder with the keypair12:22
does .ssh/config play a role in this case too?12:23
to1ne joined12:23
ikke url insteadOf only works for http(s) ifaik12:23
afaik*12:24
theoceaniscool joined12:25
bolovanos_ left12:25
kdlv joined12:26
ransu__ left12:41
geirha currybullen: a bit late to the party, but git ls-files -- ':(glob)**/.classpath'12:43
tiin57 left12:45
osse whyyyyy12:47
tiin57 joined12:49
txtsd joined12:49
txtsd What is this abomination that popped up when I tried to commit? https://i.imgur.com/y9hoTM0.png12:49
It's the first time I've ever seen it, and I don't even have a keyring.12:49
cbreak txtsd: you trying to create a signed commit?12:51
txtsd Yes, but I've done it before without having to authenticate anything.12:51
cbreak private keys are usually encrypted12:52
currybullen geirha: where is this kind of stuff even documented? i can't find anything under the git-ls-files manpage12:52
txtsd I haven't set a passphrase for that key12:52
dfee left12:52
osse currybullen: man gitglossary12:52
gitinfo currybullen: the gitglossary manpage is available at https://gitirc.eu/gitglossary.html12:52
txtsd And I never do anyway12:52
osse currybullen: under "pathspec"12:52
RaceCondition left12:53
osse currybullen: seems git ls-files '*.classpath' should work too12:57
vancz Is there a way to have git compare a local repository to a remote repository and tell me anything that isnt in the upstream , and maybe even like...pack them into somthing, so I can delete the but keep whatever I may have changed?12:58
without like, manually trying to find everything12:58
i have several copies of some repos around my disk and i want to consolidate them12:59
cbreak vancz: git push --all?12:59
bremner you can fetch them all into one reap12:59
repo13:00
and reap the rest13:00
txtsd cbreak: any idea what I should do next? I've definitely sign-commited with this key before without authenticating, and I've definitely never used a GUI while doing any git activities, so I don't understand why a GUI is popping up now.13:00
geirha though '*.classpath' will also match foo.classpath and foo/bar.classpath13:00
Orphis joined13:00
vancz a..ha13:01
guess i have to commit uncommitted changes13:01
bremner yes13:02
it won't merge anything of course.13:02
Also, make sure you use the right url scheme to defeat hardlinking13:02
cbreak txtsd: the gui is probably not git's, but gpg's13:03
RoboFlex12 joined13:03
currybullen i liked git ls-files {,'**/'}.classpath, easy to add other filenames for matching as well: git ls-files {,'**/'}.{classpath,project}13:03
osse geirha: goddammit13:03
cbreak you can find out which process it belongs to, how it was invocated (via ps maybe), and then why?13:03
currybullen maybe a little bit less portable by relying on shell functionality though13:04
oh wait, the dot has to be repeated for every name in the second set of brackets, but yeah13:04
osse git already relies on a bunch of shell functionality, though it's becoming less and less13:05
vancz bremner: what do you mean? though i dont think i have any hardlinks13:05
bremner vancz: it's about git trying to save space by not copying objects13:06
txtsd cbreak: Yes it's gpg, and it's showing under a `systemd --user`. If I kill the process it launches with the gui as soon as I try to commit.13:06
cbreak txtsd: so it might belong to gpg's agent, used for password input13:06
vancz bremner: aha. I dont know what the right url scheme is then13:07
bremner vancz: iirc file:///foo is good, but /foo will hardlink13:07
cbreak your platform's pinentry maybe13:07
txtsd cbreak: Understood that bit. Now how do I make it stop so the commit signing can happen seamlessly like it used to?13:07
cbreak are you sure your key doesn't have a password protecting the secret key?13:08
because that'd be horribly insecure13:08
txtsd Yes, I've been using that key since 2017ish and I've never had to authenticate it like this.13:08
royal_screwup21 left13:10
royal_screwup21 joined13:10
to1ne left13:11
tiin57 left13:15
royal_screwup21 left13:15
vancz bremner: aha.13:15
calcul0n_ joined13:17
jaziz joined13:18
tiin57 joined13:19
DNS777DNS13:19
vdamewood left13:19
calcul0n left13:19
aw1 joined13:28
va5c0 joined13:28
leeN left13:29
akemhp left13:29
akemhp joined13:29
royal_screwup21 joined13:30
FH_thecat joined13:36
irc_user joined13:37
independent left13:38
leeN joined13:38
RoriconKnight left13:40
drbean joined13:42
tiin57 left13:45
to1ne joined13:45
noahmg123 left13:48
royal_screwup21 left13:48
royal_screwup21 joined13:49
tiin57 joined13:49
disruptivenl left13:49
Nizumzen left13:50
noahmg123 joined13:50
sebito91 left13:50
disruptivenl joined13:51
rjstone joined13:51
sebito91 joined13:51
drbean left13:52
circuitbone left13:53
itok left13:53
Nizumzen joined13:53
ignapk left13:54
circuitbone joined13:54
itok joined13:54
altendky left13:54
fii left13:55
ignapk joined13:56
Iroha joined13:56
altendky joined13:56
va5c0 left13:58
crose joined14:01
RaceCondition joined14:06
CodeSlingerPaul joined14:07
meropyri joined14:09
leeN left14:14
tiin57 left14:15
jaziz left14:15
ChrisLane_ joined14:16
tiin57 joined14:18
ChrisLane left14:18
sudoforge joined14:23
dionysus69 joined14:24
Gurkenglas joined14:25
royal_screwup21 left14:27
royal_screwup21 joined14:28
sudoforge if i have a branch `foo` with the configuration `branch.foo.remote = upstream`, `branch.foo.pushremote = origin`, and `branch.foo.merge = refs/heads/master` (with origin and upstream being simple `refs/heads/*:refs/remotes/*` refspecs)... why, after fetching, does FETCH_HEAD represent a completely separate tree? i would expect that it would be equal to upstream/master at that point. am i missing14:29
something obvious?14:29
stats4647 joined14:30
royal_screwup21 left14:32
currybullen left14:33
AnAverageHuman joined14:34
shored left14:38
shored joined14:39
justanotheruser joined14:41
jaziz joined14:45
tiin57 left14:45
diogenese left14:46
diogenese joined14:46
RaceCondition left14:48
tiin57 joined14:49
gitter1234 left14:49
sweatsuit left14:55
Muzer left14:55
tejr left14:56
tejr joined14:57
sudoforge left14:58
royal_screwup21 joined15:01
arcatech joined15:02
akemhp left15:02
thiago joined15:05
sweatsuit joined15:10
Flynn1110 joined15:12
Muzer joined15:12
txtsd left15:12
powerhouse left15:15
gast0n joined15:15
tiin57 left15:15
h3ck left15:16
cd joined15:17
txtsd joined15:18
tiin57 joined15:19
powerhouse joined15:20
Muimi left15:23
AnAverageHuman left15:26
shabius joined15:27
causasui joined15:30
stats4647 left15:33
leeN joined15:37
dionysus69 left15:44
tiin57 left15:45
jaziz left15:47
tiin57 joined15:49
mirrorbird left15:49
powerhouse left15:54
powerhouse joined15:56
zebrag left15:56
jaziz joined15:57
zebrag joined15:59
mirrorbird joined16:00
matelot joined16:05
UlrichH joined16:05
powerhouse left16:09
powerhouse joined16:11
Borkr joined16:11
Gustavo6046 joined16:14
Borkr left16:14
tiin57 left16:15
kdlv left16:15
tiin57 joined16:18
mns joined16:22
powerhouse left16:23
justanotheruser left16:24
mi12078 left16:25
powerhouse joined16:25
barteks2x_ joined16:32
barteks2x left16:32
barteks2x_ left16:32
barteks2x_ joined16:33
mns left16:34
powerhouse left16:39
powerhouse joined16:40
akemhp joined16:41
tiin57 left16:45
theoceaniscool left16:46
tiin57 joined16:49
Aki-lucky joined16:52
Aki-lucky left16:52
Aki-lucky joined16:53
Aki-lucky left16:53
mirrorbird left17:04
powerhouse left17:05
stats4647 joined17:06
powerhouse joined17:07
roflin left17:07
otisolsen70 joined17:08
mns joined17:10
tiin57 left17:15
tiin57 joined17:18
vicfred joined17:20
roflin joined17:22
royal_screwup21 left17:25
royal_screwup21 joined17:25
mindCrime_ joined17:30
royal_screwup21 left17:30
yonder joined17:33
otisolsen70_ joined17:34
raymond left17:34
wrobinson joined17:34
wrobinson I'm using libgit2 in a small program to parse doc revisions from a database and convert to git commits17:35
from reading through libgit2.org, I've set up a fairly naive approach to getting the `add` and `commit`s to work17:36
tmz_ left17:36
mns left17:36
tmz joined17:37
wrobinson on the surface, things a starting to look functional, but noticed that when I create a further `add` and `commit`, the file17:37
gets flagged as `deleted`17:38
otisolsen70 left17:38
wrobinson I'm now assuming there's an issue with how I'm `add`ing - that somehow git figures the files are different though they share the same path17:38
mirrorbird joined17:41
arcatech left17:42
davispuh joined17:43
tiin57 left17:45
tiin57 joined17:49
jaziz left17:49
st-gourichon-fid left17:50
mns joined17:50
st-gourichon-fid joined17:51
jaziz joined17:52
otisolsen70_ left17:54
sstutzsteven17:57
UlrichH left17:57
chiastre left18:04
chiastre joined18:06
Betal joined18:10
Case_Of left18:11
sunrunner20 left18:11
Case_Of joined18:13
royal_screwup21 joined18:14
tiin57 left18:15
fstd_ joined18:16
osse wrobinson: Are you using your program in a repo and running git status after?18:16
tiin57 joined18:19
osse wrobinson: Because if that's the case then it makes sense18:19
royal_screwup21 left18:19
fstd left18:20
fstd_fstd18:20
Goplat joined18:24
dfee joined18:32
qgTG_ left18:33
Xenguy left18:38
feriman joined18:38
h3ck joined18:39
chiastre left18:39
chiastre joined18:41
tiin57 left18:45
mns left18:46
rafasc joined18:47
tiin57 joined18:48
sunrunner20 joined18:49
qgTG joined18:51
aw1 left18:56
Xenguy joined18:59
dfee left19:01
dfee joined19:06
wrobinson osse: I use libgit2 to create the repo, to perform an initial commit, then to do individual add + commit for each "doc revision"19:09
i saw that the code finished in a muddy state19:10
*finished with the repo in a muddy state19:10
checked `status` and saw the file was marked 'deleted'19:11
so ran `gdb` and found that the first file add+commit seems fine19:11
but subsequent ones would create a file with the same name, but somehow different identifier19:11
so git was adding and commiting fine, but was also flagging the "same" file as deleted19:12
tiin57 left19:15
royal_screwup21 joined19:15
Hello71 left19:15
Hello71 joined19:16
rafasc wrobinson: in git a file exists in 3 states. In the HEAD, which defines the commit you have checked out, as in the latest commit; on the index/"staging area", git add puts files in the staging area; and on the worktree, which is usually on the same directory the .git is.19:17
tiin57 joined19:19
rafasc So you get <file.txt in worktree> | (git add file.txt) -> puts file.txt in the staging area | (git commit) -> puts the files in the staging area in a commit.19:19
If you are pragmatically doing "git add", and put a file in the index without it existing in the worktree, for git it looks like the file was deleted.19:20
from the worktree.19:20
royal_screwup21 left19:20
rafasc Because the assumption is that git add is performed on existing files on the worktree.19:20
royal_screwup21 joined19:20
rafasc The same applies one level up, if you have a commit with certain files and pragmatically create a staging area where some of the files are not present, it will also look like a deletion.19:21
mindCrime_ left19:21
mindCrime_ joined19:22
wrobinson rafasc: excellent explanation - thanks19:22
so looks like my current solution is a little too naive19:22
as I start I guess I should figure how to build the worktree19:23
rafasc wrobinson: I'm not sure which is your specific case, but if you're doing it pragmatically you can generally ignore the worktree state.19:23
wrobinson do you mean programmatically?19:24
rafasc wrobinson: when you finish, you can do a git checkout HEAD; and git will materialize the files.19:24
wrobinson aha!19:24
that makes sense - so I'm making the commit, but not updating HEAD19:25
cdown_ joined19:25
rafasc It's hard to say, but if you're getting "deleted", you're either adding things to the staging are without updating the worktree, or changing the index in a way it removes the files when compared to HEAD>19:26
you can tell which one it is by using git diff; and git diff --staged;19:27
cdown left19:27
cdown_cdown19:27
rafasc the "git commit" action, should itself update the HEAD.19:28
wrobinson rafasc: atm i think my code basically does whats outlined here: https://libgit2.org/docs/examples/init/ (but with an additional `git_index_add_bypath()`19:28
thanks again, I'll check out the diffs19:28
yeah, I thought commit would update the HEAD, but wasn't sure if something different was happening when using the lib code19:30
rafasc wrobinson: let me guess, the path you're passing is outside of the git repository19:30
wrobinson nope19:30
i init a repo19:30
then use c to build the directory structure inside it19:30
and add the files19:31
(all without updating git)19:31
then for each file, I do a git add and commit; perform a "revision" on the file; and repeat19:31
i ran the diffs you suggested19:32
`git diff` returns empty19:33
rafasc then the problem is more complex than what I imagined.19:33
that means your worktree and your staging area matches.19:33
wrobinson `git diff --staged` shows a deletion (like the opposite of the revision i just committed)19:33
j416 what is all this for?19:33
wrobinson j416: taking cloud9 IDE document revisions, and converting to a git repo19:34
rafasc: Is it possible I'm messing up something with the "parent" value when committing19:34
?19:34
j416 wrobinson: maybe man git-fast-import is of use?19:35
gitinfo wrobinson: the git-fast-import manpage is available at https://gitirc.eu/git-fast-import.html19:35
wrobinson j416: interesting, thanks19:36
rafasc wrobinson: if git diff --staged is showing deleted, it means the files are no longer present on the index.19:36
pacuna joined19:37
rafasc does git update-index -g; change anything?19:38
wrobinson so when i say my code performs a revision, it reads the file to a buffer, then also re-opens the file in O_WRONLY, truncates it to be blank, then performs the revision based off of the buffered content19:38
shailangsa left19:38
wrobinson but still gets saved to the same filename19:38
so i figured that should all be fine19:38
one moment, checking19:38
shailangsa joined19:38
wrobinson nope19:39
I assume I need to call the `add` function before every commit, like i would do with the commandline19:40
rewt I agree with j416, git-fast-import is the tool you should be using for this... you're basically doing what those cvs-to-git, hg-to-git, etc type of tools do, and they also use git-fast-import, iirc19:40
rafasc wrobinson: yes, you do19:40
SuperLag joined19:41
wrobinson rafasc: if you're interested: https://paste.ubuntu.com/p/W3T2BFYSyC/19:41
hopefully it's not too horrible19:41
rafasc using libgit might be easier if you're used to how git itself does things. To use fast-export you have to learn its stream format.19:42
wrobinson rewt: thanks - i definitely will look into it19:42
rafasc Shouldn't be too hard to learn it though.19:42
wrobinson would at least be nice to understand what's causing this problem though19:43
seeing as it's not directly my use-case that is the issue19:43
i'm wondering if i'm buggering stuff up with the commit parent19:44
tiin57 left19:45
rafasc I think I know what's happening.19:46
tiin57 joined19:48
rafasc or maybe not.19:49
wrobinson: are you sure you're passing the existing index to this function?19:49
wrobinson yes, the index doesn't change right?19:50
i just tried the approach for getting the `git_commit *` to HEAD here: https://www.git-scm.com/book/en/v2/Appendix-B%3A-Embedding-Git-in-your-Applications-Libgit219:50
rafasc I would suspect that if you would call this with a blank index, you would add one file and it would work, but on the second add, the first file would show as deleted while the second file would show as added.19:50
wrobinson hmm, makes sense, but think the index is valid19:51
and the code I just tried seems to work19:51
so far, I think19:51
rafasc a valid index doesn't mean it's the index you want.19:51
wrobinson ah fair point19:51
rafasc i.e. a blank index is valid.19:51
wrobinson and no, the edit didn't help19:52
ok, hceking19:52
checking*19:52
j416 wrobinson: in a regular repo when "git status" says clean with nothing to commit, the index matches your last (current) commit19:52
geosmile left19:53
wrobinson ah19:54
i misread the docs - i've been using the repo index19:54
Heirlung left19:54
wrobinson from `git_repository_index()`19:55
Heirlung joined19:56
mowcat joined19:56
royal_screwup21 left19:57
royal_screwup21 joined19:57
JanC left20:00
to1ne left20:01
Flynn1110 left20:02
JanC joined20:04
tarkus left20:06
royal_screwup21 left20:11
royal_screwup21 joined20:11
wrobinson ok, it looks like i in fact did read the docs correctly20:12
the repo index is used: https://libgit2.org/libgit2/ex/HEAD/add.html20:13
i let the code run, it finishes with the same 'deleted file' status20:14
but I have 80 (what appear to be) successful commits in `git log`20:14
foul_owl_ left20:14
tiin57 left20:15
rewt if you checkout the commits, do they contain all the files that they should?20:15
blaisebool joined20:16
royal_screwup21 left20:16
wrobinson checking (atm I'm only testing with one file)20:18
tiin57 joined20:18
wrobinson so I'm just running some diff tests, e.g. `git diff HEAD~43 HEAD~42`20:18
it appears that after a commit, there's the staged delete, but running another update and commit seems fine, but just leaves another staged delete20:20
I'm obv messing _something_ up20:20
hmm. `git status` shows the parent directory as not added20:22
rewt are you creating the file in the worktree (the actual directory)?20:23
or just adding to the index?20:23
wrobinson I create the file using `open()` and `write()`. I assume thats what you mean by creating in the actual dir20:25
royal_screwup21 joined20:25
rewt yes, so a simple 'ls' will show the file20:25
wrobinson yes20:25
I also have a .bak of the original doc in it's final state (after all revisions)20:25
and can vimdiff them with no differences against the ones written alongside the git stuff20:26
cosimone joined20:27
wrobinson (that's not entirely true it appears, but just looks like some formatting errors)20:28
foul_owl_ joined20:28
feriman left20:36
cuppajoeman joined20:38
cosimone left20:38
cuppajoeman I found this file https://github.com/github/gitignore/blob/master/Python.gitignore. If I use the `Python.gitignore` file directly in my directory will it work or does it have to be named `.gitignore` ?20:38
arcatech joined20:39
cosimone joined20:40
wrobinson rewt: j416: rafasc: thanks again for the help. I'm gonna have to rest and try again tomorrow with a (hopefully) clear head20:40
rewt cuppajoeman, it has to be .gitignore20:40
cuppajoeman Ok, thanks!20:41
HumanG33k joined20:41
tiin57 left20:45
rafasc wrobinson: It?s worth noting that this doesn?t actually write the index to disk. There?s a separate call for that: git_index_write. All this code does is use the empty index to get the SHA-1 hash of the empty tree.20:46
https://libgit2.org/docs/examples/init/20:46
HumanG33k left20:46
tiin57 joined20:48
justanotheruser joined20:48
wrobinson rafasc: ah. thanks again. will need to do more digging and reading20:51
so `git log` still shows what's expected, but still no index is written to disk?20:52
akemhp left20:53
wrobinson also, did another quick test while the app is in mid-state (directories have been created and files exist on disk)20:55
and the initial commit performed20:55
I then manually ran `git add top-dir/subdir/file.c` which immediately altered how `status` looks20:56
eb0t_ left20:57
wrobinson it (as I would expect) no longer complained about "top-dir" in the same way as being untracked20:57
whereas, if i let my code run, it's as though all of the files are still untracked20:57
(sorry if thats a poor/unclear explanation)20:57
pacuna left20:58
mns joined21:01
cosimone left21:01
cosimone joined21:01
tiin57- joined21:02
tiin57 left21:02
epsilonKNOT left21:03
cosimone left21:03
W3BV1P3R joined21:04
W3BV1P3R left21:05
cosimone joined21:05
matelot left21:09
vicfred_ joined21:10
vicfred left21:12
tiin57- left21:15
epsilonKNOT joined21:15
royal_screwup21 left21:16
cosimone left21:16
royal_screwup21 joined21:16
cosimone joined21:17
tiin57 joined21:19
royal_screwup21 left21:21
akemhp joined21:30
cosimone left21:32
acetakwas left21:32
acetakwas joined21:33
xphacter left21:34
POQDavid left21:36
POQDavid joined21:37
POQDavid left21:38
acetakwas left21:38
POQDavid joined21:38
RoboFlex12 left21:38
acetakwas joined21:39
POQDavid left21:41
shicks_ joined21:42
acetakwas left21:43
acetakwas joined21:44
shicks2525 left21:44
pikapika left21:44
pikapika joined21:44
nikivi left21:45
cosimone joined21:45
nikivi joined21:45
tiin57 left21:45
pikapika left21:45
pikapika joined21:45
acetakwas left21:45
acetakwas joined21:47
mindCrime_ left21:47
nikivi left21:47
igemnace left21:47
nikivi joined21:47
mindCrime_ joined21:47
j416 wrobinson: sleep well, I hope you figure it out. z/21:48
tiin57 joined21:48
calcul0n_ left21:49
gschanuel joined21:56
g00s joined21:56
mns left21:57
RoboFlex13 joined22:00
gschanuel left22:01
gschanuel joined22:02
gschanuel left22:02
gschanuel joined22:02
barteks2x__ joined22:03
barteks2x_ left22:03
gschanuel left22:03
raymond joined22:12
acetakwas left22:14
pikapika left22:14
royal_screwup21 joined22:14
tiin57 left22:15
pikapika joined22:15
acetakwas joined22:16
acetakwas left22:16
acetakwas joined22:17
tiin57 joined22:18
justanotheruser left22:18
royal_screwup21 left22:19
blaisebool left22:20
surfist left22:29
Kaedenn1 joined22:34
Kaedenn1 Are git hooks part of the repository? If I create a pre-commit hook, can I ensure other people who clone the repository obtain the same hook?22:35
We're designing a new CI system and I want to ensure certain constraints: checked-in code should compile without errors and code may not be checked-in directly to a non-development (qa, prod, training) branch.22:37
I'm concerned the latter would happen if someone pulls code out of the prod branch and forgets to change which branch they commit to.22:38
mns joined22:40
to1ne joined22:40
rafasc Kaedenn1: no, for security reasons hooks are not transferred on clones.22:41
Kaedenn1 Does git provide some sort of mechanism for me to implement these needs?22:41
rafasc Kaedenn1: in general, anything that goes inside .git is out of bounds for clone.22:41
Kaedenn1: usually what you do for that is use git hooks on the server, and refuse any pushes that do not fit your criteria.22:42
Kaedenn1 Server hooks? We're using github.com, how do I configure server hooks for the repos in question? Also, we have ~300 repos, is there a way to configure these hooks on an org level?22:43
mns left22:45
tiin57 left22:45
rafasc you need a pre-receive hook, but I think you would need github enterprise for that.22:47
Kaedenn1 We have that.22:47
So a pre-receive hook could populate the repository with desired local hooks.22:47
rafasc No. the pre-receive hooks can deny pushes that do not fit your criteria.22:48
Kaedenn1 (this is all code internal to our organization and only approved people can see the code, let alone make changes)22:48
rafasc There's no way to enforce hooks on clients.22:48
Kaedenn1 Do those hooks run on the server, e.g. github.com?22:48
rafasc yes22:48
tiin57 joined22:49
Kaedenn1 So there isn't a way to ensure our code compiles upon checkin, then, because we use a proprietary compilation system installed locally. z_z22:49
Unless we wrap checkin in some other script and invoke that instead of git commit.22:49
rafasc you can politely ask devs to install client side hooks.22:49
but there's no way to enforce them to run said hooks. they can always skip it with --no-verify, or by creating commits with lower level commands that do not trigger the hooks.22:50
Kaedenn1 Is it possible to have global client-side hooks that run for all repositories inside of our org? Again, we have ~300 repos and I'm not sure how I'd ensure everyone has the right hooks.22:50
Oh, we'd use a "please don't do that" method of enforcing that.22:50
We're a team and we trust each other.22:50
s/right hooks/right hooks everywhere/22:51
rafasc you can make git read the hooks from a shared directory by configuring core.hookspath22:51
Kaedenn1 Then I can set that via a global system-wide git config.22:52
rafasc yes, but people cloning will not get those hooks.22:52
Kaedenn1 The developers can only check in code from a central system (whether the proprietary compiler suite is installed). This is an artifact of our current VCS.22:53
The simplest option here is to do what our existing VCS/migration system does: scripts for checkout, checkin, etc.22:54
Users /can/ invoke the git commands directly to bypass everything, but we'll ask politely they not do that.22:55
arcatech left22:55
rafasc I have no ideia "what can only check in code from a central system" means. But with git, it is not possible to clone in a way that you inherit the hooks of whatever you are cloning.22:55
Kaedenn1 There's a common "development server" we all use.22:55
We check out code to our locations on that server, we compile code on that server, and we check in code from our locations on that server.22:56
Users can check out the code to any machine they please, but they won't be able to compile it.22:56
irc_user left22:56
Hello71 left22:56
rafasc people usually either include the hooks as part of the repo, and ask users to configure hookspath, or make it part of their build scrip to check the critearia.22:56
Kaedenn1 (unless they install the same compiler suite from our vendor)22:56
rafasc Kaedenn1: "we check out code" is not clear22:57
vicfred_ left22:57
Kaedenn1 by "we check out code" I mean obtaining repo/file.c from github.com/org/repo/file.c22:57
s/-file.c/file.c/22:58
extracting code out of our version control system, github.com/org/repo22:58
Hello71 joined22:59
Kaedenn1 We're rebuilding our entire VCS and migration systems from scratch because we have an ETA for losing our current one. So I'm in charge of designing how all of this works given the constraints we have. I really have no clue what I'm doing.22:59
rafasc well, not being able to enforce hooks is just another constraint you'll have to consider.23:01
Kaedenn1 Two big constraints I need to work around: 1) changes may only be pushed to the dev (or a development) branch; changes shouldn't be pushed to the qa or production branches, 2) (compiled) code must compile without error before pushing changes23:02
cosimone left23:04
rafasc 1) is relatively easy to do it server side. 2) is impractical to put in a server side hook as you would need to compile it on the server to decide if the push is allowed or not.23:04
the alternative is to use pre-push client side, and check there. But pre-push is a client hook, and there's no way (deliberate) to enforce that.23:05
Kaedenn1: if you're using github, why don't you use something like github actions to compile your code and invalidate the PR?23:06
you can host your own runners with github actions.23:06
So you could include whatever compiler you need to compile it.23:07
Kaedenn1 ...so we can use some kind of web-hook to invoke code on our server based on an action on github.com? Is the request inbound (to our server from github) or outbound (from our server to github)? The former will require firewall rules.23:07
...is there a way to do this via github -> jenkins? We have a Jenkins setup and if that can receive Github triggers and do things, that'd work.23:08
Actually no, crap.23:09
pikapika left23:15
acetakwas left23:15
tiin57 left23:15
pikapika joined23:15
acetakwas joined23:16
tejr left23:17
tejr joined23:17
acetakwas left23:18
tiin57 joined23:18
acetakwas joined23:19
theoceaniscool joined23:30
pikapika left23:32
akemhp left23:32
pikapika joined23:32
theoceaniscool left23:36
nikivi left23:40
nikivi joined23:41
justanotheruser joined23:41
nikivi left23:41
acetakwas left23:42
nikivi joined23:42
acetakwas joined23:44
tiin57 left23:45
tiin57 joined23:48
cdown left23:53
cdown joined23:55
Gustavo6046 left23:55
foul_owl_ left23:56

Logs Search ←Prev date Next date→ Channels Documentation