IRCloggy #git 2022-03-25

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-03-25

bn_work hi, git 2.32.0, attempting to push a commit and was getting an error saying there were changes pushed that I needed to pull first, so I pulled and it did a merge commit message with ` 1 file changed, 2 insertions(+), 1 deletion(-)` , but how I do I see the merge commit lines? When I do `git show ` <commit#>, it just shows the commit # and message, that's it, vs the actual lines that changed?00:02
jazzy left00:02
wakeup left00:04
BtbN you need to look at the actual commits it merged00:04
the merge commit will only contain changes if there were conflicts to resolve00:05
and you generally do not want to create merge commits when pulling. They pollute the history00:05
git pull --rebase is much nicer00:05
ghost43 left00:06
ghost43 joined00:06
sa0 left00:09
bn_work BtbN: how do I know what it merged? it doesn't show anything when I look at it?00:10
sa0 joined00:10
BtbN it merged your local branch with the one you pulled.00:10
bn_work so how do I see what it did?00:11
BtbN What do you mean?00:11
bn_work it says ` 1 file changed, 2 insertions(+), 1 deletion(-)`00:11
BtbN If there were no conflicts, it just merged the two histories with a merge commit, and put it on top of the two diverged trees00:11
That's the changes the commits you pulled did. Not the merge commit.00:12
bn_work ok, so how do I see them?00:14
rewt easiest is to use gitk (or a similar gui)00:14
sa0 left00:15
parsnip wait what?00:16
doesn't a merge commit have a diff?00:16
if the two tips were different00:16
i just tested this00:17
bn_work rewt: why can't `git show` show this? I don't want to see a graph of trees?00:17
parsnip maybe magit is doing some magic00:18
bn_work or IIRC, when one does a merge, it pulls the commit and it just shows up in the history?00:18
parsnip git show seems to work here00:19
chenqisu1 joined00:19
parsnip "it"?00:19
shows up where?00:20
are you referring to your git tool?00:20
merge pulls a commit?00:20
rewt bn_work, it can, if you can interpret what it's saying, but it's much clearer in a gui00:20
parsnip i'm confused by your terminology00:20
i might recommend staying away from pull, and using fetch, until you know the difference00:20
bn_work parsnip: it = git00:21
Strom left00:21
bn_work parsnip: no, git itself, I'm using git directly00:21
parsnip `man git-show ==> For commits it shows the log message and textual diff. It also presents the merge commit in a special format as produced by git diff-tree --cc.`00:21
gitinfo the git-show manpage is available at https://gitirc.eu/git-show.html00:21
bn_work fetch just downloads00:22
right, so why isn't `git show ` <merge_commit#> not showing anything?00:22
Strom joined00:22
bn_work it's just 1 file, 2 insertions and 1 deletion00:23
rewt compared to what? a merge commit has multiple parents00:23
parsnip how strange, that merge commits don't have a diff00:23
strictly speaking00:23
zeenk left00:24
rewt technically a commit in git is a snapshot of the dirs/files; diffs are comparisons between 2 commits00:24
bn_work so wait, when I do a merge commit, is it leaving behind those `>>>YOURS` and `<<< THEIRS` junk and I have to manually clean it up?00:24
(with default merge algo)00:24
parsnip it sort of makes sense. if they had a diff, it could be considered redundant to the ancestor diffs00:24
rewt yes, those are conflict markers that you have to resolve00:24
parsnip bn_work: works fine here00:24
rewt anything that git itself cannot resolve, you have to resolve yourself00:25
reprazent left00:26
bn_work rewt: will it tell me if there were parts it couldn't resolve?00:26
rewt yes, those markers are around sections it cannot resolve00:27
bn_work I didn't get any notification that there were conflicts that I needed to resolve?00:27
rewt are you sure? git's feedback is quite verbose, and most people just gloss over most of it00:28
reprazent joined00:28
NeilRG left00:28
perrierjouet left00:29
bn_work It literally brought up my editor (vim) to type in a merge commit message, then exited00:30
rewt then there were no conflicts and you shouldn't see those markers00:31
unless they were there before00:31
on either branch00:31
perrierjouet joined00:31
bn_work sorry, looks like it used `recursive` strategy00:34
llh joined00:34
Arokh left00:35
bn_work here's the log, ie: I basically tried to push, it mentioned the error, so I tried to pull first, and it immediately brought up the editor, I accepted it's proposed message, quit https://www.irccloud.com/pastebin/4kAjb9cJ/git_push_git_pull.log00:36
zmt00 left00:36
bn_work rewt: so how do I see what it did?00:37
zmt00 joined00:39
srinidhi left00:43
kaiseisei joined00:43
wilz joined00:43
parsnip bn_work: i'm confused. was there a conflict? how are you getting lines with `>>>YOURS` but no merge conflict?00:44
rewt bn_work, do you have those markers in that file?00:47
DoofusCanadensis joined00:49
Rashad left00:50
Arokh joined00:54
junktext left00:55
Techcable left00:55
BUSY left00:57
Techcable joined00:57
clime left00:57
jamiejackson left01:00
bn_work parsnip: I don't know, that's my point, lol. It didn't claim there was any, the output I got above was all I got. But was I supposed to? or does a merge commit just merge and leave you to resolve them? (normally I thought with merges, git tells you to commit the resolved version when done)01:02
BUSY joined01:02
elastic_dog left01:03
jstein left01:04
bn_work rewt: I'm not seeing any markers like that in `Baz/whiz-3.5_blah.bash` for ex01:04
parsnip do you have the markers01:04
bn_work parsnip: ? ^^^01:04
rewt do you have them in any file?01:04
parsnip i guess you were asking above, "today am i learning, that merges will be smooth unless there's a conflict, at which point there will be markers for what i need to resolve"01:06
FinnElija left01:06
perrierjouet left01:06
parsnip so you didn't mean that you saw markers in this particular merge instance01:06
bn_work rawtaz: I'm not seeing it any of the files in that dir. shouldn't it be constrained to what it mentioned it? ie: `Baz/whiz-3.5_blah.bash`?01:06
FinnElija joined01:06
bn_work parsnip: that's not a question, but ok :)01:07
ghost43 left01:07
parsnip bn_work: can you share the result of `git show` for the merge conflict?01:07
bn_work parsnip: correct, I was just giving an example of what I normally associate with merge conflicts01:07
again though, how do I see what it merged???01:07
elastic_dog joined01:07
parsnip > so wait, when I do a merge commit, is it leaving behind those `>>>YOURS` and `<<< THEIRS` junk and I have to manually clean it up?01:08
ghost43 joined01:08
mud joined01:08
parsnip "today am i learning, x, y, z", is a question01:08
jclsn left01:08
rewt bn_work, what do you mean by that? it merged the 2 parent commits; what you had as master and what master was on origin01:08
parsnip worrying about particular grammars doesn't seem useful at the moment01:08
k8yun left01:08
perrierjouet joined01:08
parsnip you don't want to share the output of `git show` for the merge commit?01:09
(i meant git show for merge commit not merge conflict)01:09
bn_work `$git show 48379aa` `48379aa N 2022-03-24T19:56:04-04:00 JDoe.. Merge branch 'master' of https://github.com/Foo/Bar HEAD -> master`01:09
thebombzen left01:09
Codaraxis__ left01:10
rewt are you asking to see the diff between the merge commit and one of its parents?01:10
bn_work parsnip: ^^^01:10
that's literally all it shows01:10
rewt: sure01:11
rewt `git diff <parent>..<merge>` # replace <merge> with your merge commit, and <parent> with the parent you want to diff against01:11
parsnip that's not what git shows me for a merge commit01:12
jclsn joined01:12
bn_work rewt: ok, I think that worked01:13
parsnip: 🤷 maybe different git config settings?01:14
parsnip try `git show 197ff17` for https://github.com/bradyt/git-merge-example01:14
it shows me parent commits for example01:15
parent commit hashes01:15
so i'm not sure why your `git show` omits that01:15
rewt `git show` for a non-merge commit shows the diff relative to its single parent; `git show` for a merge commit doesn't show the diff because it won't pick a parent at random... but if there were conflicts that were resolved, I think it shows the resolution diffed against both parents01:15
bn_work rewt: so by merging like this vs rebasing, did I lose the original commit# & message from origin:master?01:16
rewt no, you created a merge commit with 2 parents; your master and origin/master... with --rebase, you would've ended up with a linear history with no merge commits01:16
parsnip i don't think i have much configured01:16
bn_work parsnip: can you show me what you see? do you just get a normal diff?01:16
roadie joined01:17
jclsn left01:18
parsnip bn_work: https://dpaste.org/MoH401:19
bn_work rewt: but the other parent is remote, no? or is the other parent copied locally (albeit hidden) as remote?01:19
parsnip oh, diff highlighting failed, raw would be better: https://dpaste.org/MoH4/raw01:20
ferdna left01:20
rewt bn_work, when you fetch, you copy everything that's remote to your local repo01:20
bn_work rewt: right01:20
parsnip rewt: git show doesn't display a diff? that seems to contradict my example above, and what i quoted from man01:21
roadie left01:22
parsnip fetch would have divergence, between origin/master, and master, i guess01:22
bn_work parsnip: interesting, yeah, I don't get that diff with `git show ...`01:23
parsnip i would imagine my workflow, would be to fetch, consider the graphical log, the changes in divergence, then decide what to do01:23
bn_work rewt: so is the reason I don't see the original remote commit + message is because it got squashed as 1 merge?01:23
jclsn joined01:24
bn_work rewt: if so, would rebase allow me to pickup the original commit + message?01:24
rewt parsnip, what you quoted is what i said (read the whole thing you quoted, and relevant sections of the other man page too)01:24
warblr left01:24
bn_work rewt: I hesitated to use rebase as it normally changes commit #s rewriting history, no?01:24
parsnip if it seemed more complicated than a clean rebase, i might rename my local master, reset local master to origin/master, then consider the best way to adopt changes from my renamed branch01:25
rewt bn_work, not `git pull --rebase`01:25
nyah left01:25
bn_work The other question is, can I do anything about it now :/ (FWIW, this is just a repo used only by me on 2 machines)01:25
parsnip er, add new branch at current local master, and reset local master to match remote01:25
rewt parsnip, did you resolve conflicts in that merge?01:26
bn_work rewt: uh, not following... so rebase wouldn't help?01:26
parsnip put a new branch ref on your local divergent "tip"01:27
rewt: i'm going to sound rude, but i'm trying to understand your question. does it look like there's a conflict there?01:28
ghost43 left01:28
parsnip rewt: i provided an entire repo, if you missed it01:28
humanBird joined01:28
rewt parsnip, no, which is why i'm confused... I don't get diffs with git show either for a merge commit, and the man page also says it doesn't show it01:28
duxsco left01:29
ghost43 joined01:29
bn_work parsnip: now I'm afraid to push commits from my other machine if pulling them down here with lose the original commit messages :/01:29
duxco joined01:29
bn_work s/with/will/01:30
parsnip rewt: i think we should ask bn_work for a log of current situation, advise to back things up, then consider resetting things towards what occurred before the pull01:30
i don't want to compete to give advice >.< i'd rather just come to a consensus01:31
i'm giving the benefit of the doubt that you know git more than me01:31
i forget the bot command to ask for a log01:31
duxcoduxsco01:31
rewt !log01:32
gitinfo [!irclog] Public logs of #git are kept at: https://gitirc.eu/log01:32
rewt nope01:32
!terminal01:32
parsnip for example, it seems relevant to ask if they pushed the merge to origin yet01:32
jclsn left01:32
parsnip in fact, i would guess they can leave master where it is currently, put a temporary branch on the old local commit, and test how the rebase would work from there, to the old origin/master01:34
rewt yea01:34
bn_work FWIW, (luckily) I can rewrite history if I really need to (I know it's usually not good practice, but 99% I'm the only one using this repo)01:34
parsnip assuming they thing rebase is better01:34
rewt i recommended gitk because it's so much clearer seeing the history visually than to figure it out on the command line (and possibly misinterpreting the output)01:35
bn_work parsnip / rewt: what I've been doing is basically development on two machines and doing a git pull accepting the merge commit then pushing the local commit to remote01:35
parsnip *think01:36
rewt bn_work, if it's the same branch, `git pull --rebase` is generally better ... the only history it's rewriting is your local history only of the commits since the divergence, replaying them back on top of what you fetched from the remote01:36
bn_work there's also only 1 branch (and one dead branch from long ago)01:36
it's really simple dev workflow now (ie: just me)01:36
(although may change soon in the future)01:36
rewt even for multiple people, if you want to "catch up the current branch to its latest version, keeping any changes", `git pull --rebase` is the best option01:37
i'm not sure what you meant here: <bn_work> rewt: so is the reason I don't see the original remote commit + message is because it got squashed as 1 merge?01:38
there was no squashing that you mentioned, so everything should still be there01:38
bn_work rewt: ok, so reset hard or so? (I forget the specific variant I need) and re-pull with `git pull --rebase`? (I've rebased interactively before but only locally and not in the context of a merge... or maybe I have long long ago, it's been a while since I've had to deal with merges- I try to avoid them, lol)01:39
jclsn joined01:39
bn_work reset to pre-1st merge01:39
rewt no, just `git pull -rebase`01:39
why reset?01:39
if you want to try that now, you have to unwind the merge commit first01:41
sa0 joined01:43
seds joined01:44
parsnip y'all not reading what i'm saying, i'm out01:44
gitk didn't come with my install01:45
rewt it's packaged separately on linux01:46
bn_work rewt: because it's already been merged?01:46
don't I need to rewind back to before the 1st merge?01:46
rewt what 1st merge?01:47
parsnip reset would be one way to unwind01:47
Codaraxis joined01:47
bn_work parsnip: you mean the suggestion to backup and create new temporary branches? sounds very complicated :/01:47
jclsn left01:47
bn_work rewt: I've already done at least two merge commits during the pull01:48
perrierjouet left01:48
bn_work and subsequently `git push`-ed so my other machine could see it and pull it down01:48
rewt pull is only a single merge.... git pull is the same as git fetch followed by a single git merge01:48
bn_work sorry, what I said was unclear, I've done at least 2 merge commits in separate pulls01:49
rewt you have multiple remotes?01:49
parsnip !backup01:49
gitinfo Worried about your data while trying stuff out in your repo? The repository in its entirety lives inside the .git directory in the root of your work tree so to backup everything `cp -a path/to/workdir path/to/backup` or equivalent will suffice as long as the repo is not modified during backup. See also http://sethrobertson.github.io/GitBestPractices/#backups01:49
bn_work rewt: no01:49
for this repo?01:50
parsnip bn_work: i can't imagine using git without being comfortable with creating temporary branches01:50
i do it all the time01:50
bn_work parsnip: I guess branching isn't that hard, I just hope it doesn't make subsequent merges complicated01:50
parsnip i suggested we get a log01:50
noone listens to me01:50
bn_work parsnip: I've been trying to keep my workflow as simple as possible01:51
rewt `git branch tempbranch` creates a branch at the current commit, so you can reset to wherever you want, and you can get back to this same one if something goes wrong01:51
pyeverything joined01:51
rewt a branch in git is just a pointer to a specific commit01:51
bn_work rewt: yeah, I think that's what parsnip was suggesting01:51
rewt yes01:52
jclsn joined01:52
bn_work I was just worried it would interfere with subsequent pulls since the entire repo is compared during a pull for conflicts?01:52
parsnip bn_work: we're not at the same computer as you, trying to give commands. it's too easy of a possibility to mess something up. suggesting to back up your repo is a safe request from my point of view01:53
bn_work rewt: so why wouldn't I need to do a reset?01:53
rewt depends on what you want to accomplish01:53
bn_work parsnip: is it just copying out the entire tree?01:53
rewt: like I said, I just want to get the original commits & their message from my other machine that was pushed, and vice versa01:54
right now I think they are just showing up as merge commits01:54
rewt bn_work, no, creating a branch is essentially creating a new "thing" that says "this is the commit i'm pointing at", doesn't copy anything, doesn't duplicate anything, and lets you easily get back to the same point01:54
bn_work, the ony merge commits you have are the merge commits you created with `git merge` (remembering that `git pull` is just short-hand for `git fetch && git merge`)01:55
parsnip iiuc, typically a merge looks at two commits, often implicit01:55
er01:56
pyeverything left01:56
parsnip one branch ref, and usually one other implied commit, maybe01:56
jclsn left01:56
jclsn joined01:56
bn_work rewt: yes, I was asking parsnip about what he defined as "backing up"01:57
parsnip i think we really need a log, to more easily advise01:57
bn_work rewt: so again, why don't I want to git reset back to before I first did my first merge commit?01:57
parsnip the --oneline --graph --decorate or w/e variety01:57
they're describing two merges, i think a log will clear it up01:58
bn_work: just copy the directory, like `cp foo foo.bak`01:59
bn_work parsnip: ah, ok, one sec01:59
parsnip bn_work: if something goes wrong, you have a backup. if nothing goes wrong, you delete it01:59
because you're asking for advice across text based chat01:59
rewt bn_work, best if you pastebin the output of `git log --oneline --graph` as parsnip says02:00
parsnip it probably won't be needed, but it's easy to make02:00
rewt much easier than trying to describe the repo without knowing what it looks like02:00
parsnip oh, maybe --decorate is default now02:02
srinidhi joined02:04
bn_work parsnip https://www.irccloud.com/pastebin/FTJvhfoX/git%20log%20--oneline%20--graph%20--decorate.log02:04
rewt that's the full output?02:06
jclsn left02:07
parsnip the merge at 7edfe48 is the only one not from today?02:07
sa0 left02:08
parsnip i'm trying to think what sequence of events gets to 066c03c02:08
jclsn joined02:09
bn_work and from machine 2 it looks like this: https://www.irccloud.com/pastebin/JQX9Uck0/git%20log%20--oneline%20--graph%20--decorate_from_machine2.log02:09
parsnip oh, just that diff, is all02:09
so that machine didn't have the changes yet, maybe02:09
so in a sense, a16b6eb was merged twice02:10
not in a literal sense, just in a, "second machine" sense02:10
rewt it was only merged on one, then pushed, then fetched on the other02:11
went into 7edfe48 in both logs02:11
parsnip i guess machine 1 had master at 8df9c3a, recently02:11
rewt yes02:12
parsnip okay, you could "rebase" 8df9c3a onto 65efe9e, i'm not sure that's the optimal fix02:12
bn_work rewt/parsnip: it looks like the first one is a superset so I think I see what you mean about not needing to reset, so I just rebase off from ab75188?02:12
parsnip if it were me, i would probably make this entirely linear, but that could easily be difficult to convey over chat02:13
bn_work are all those other branches in other branches? I don't see them when I do `git branch -a`? or at least I don't think I do?02:13
rewt bn_work, question is if you want to re-do the whole history, or just this last one?02:13
parsnip oh, that's an interesting question02:13
work from the initial commit, start reshaping the commits, then force push02:14
you could even draft the redo, with temporary branch02:15
rewt if you want to change it all to a linear history, you can do `git rebase -i ab75188`, and put the commits in order (top is first chronologically)02:15
parsnip are the commit messages stable? because soon the commit hashes won't be02:15
rewt yep, you can `git checkout -b newbranch`, and do the interactive rebase with that02:15
parsnip decide what order you want the commit messages02:16
oh, interesting idea02:16
jclsn left02:16
parsnip i would have used a pair of temporary branches02:16
i'm not sure i've used interactive rebase over merges02:16
Sulky left02:17
parsnip anyways, i've got to go for groceries, best of luck, regardsj02:17
*regards02:17
rewt interactive rebase is pretty powerful; you can reorder commits, change metadata (message, author, etc), edit commits, etc02:17
FFY00_ joined02:18
FFY00 left02:18
bn_work rewt: yes, that's basically what I want to do, rebase it so it's linear and the original commit messages are shown vs these merge commits. I'm still confused why I don't see these other branches in git branch -a output02:18
rewt which other branches?02:19
you said you only have master02:19
bn_work parsnip: thanks parsnip02:20
rewt: yes, that's what I thought but that tree view (with multiple ANSI colors that didn't copy) now has me confused :/02:20
Murr left02:20
thebombzen joined02:20
Murr joined02:21
rewt the colours are there only to make it easier to trace the lines, they serve no other purpose02:21
ghost43 left02:21
ghost43_ joined02:21
jclsn joined02:21
geowiesnot joined02:22
rewt with more complicated histories, it helps quite a bit02:22
duxsco left02:22
bn_work rewt: so did this create 3 branches?02:23
rewt no, there's only 1 branch: master02:23
in git a branch is just a pointer to a commit02:24
bn_work right, but I see 3 vertical lines now so obvious there's 3?02:24
rewt they're just separate "ancestry paths" (no git term for it really)02:25
anyways, to get the history linear, start with: `git branch oldmaster` # to create a new branch called "oldmaster" (don't worry about the name, it's only temporary)02:25
bn_work rewt: but not "branches" as created by `git branch ...` ?02:25
rewt yes, and in git, a branch is simply a pointer to a specific commit02:26
when you delete a branch, all traces of it disappear02:26
bn_work I assume I want to do this on machine(1) which is a superset of machine2 (which doesn't have everything, yet?)02:26
rewt when you commit, git doesn't record what branch was checked out at the time, it simply makes a new commit, sets the current one as its parent, and moves the branch pointer to the new commit02:26
yeah, do it on the one that has the latest02:27
bn_work I wonder if i'm not seeing the branches in my normal `git log` because I'm doing: `format.pretty=format:%C(auto,yellow)%h%C(auto,magenta)% G? %C(auto,blue)%>(25)%ad %C(auto,green)%<(7,trunc)%aN %C(auto,reset)%s%C(auto,red)% gD% D`02:28
rewt do you have any changes at all on the other machine? even not committed changes?02:28
bn_work "branches"02:28
rewt no, you only have 1 branch; "master", there are no other branches; in git, branches are not "chains of commits"02:28
or rather, "chains of commits" are not branches02:29
ghost43_ left02:30
Murr left02:30
bn_work on machine2 I have ~15 modified uncommitted files, ~40-50 untracked files02:31
ghost43 joined02:31
bn_work machine1 is basically a new machine I've started using to dev on concurrently (possibly a bad idea)02:31
pizdets_ left02:32
rewt best if you commit everything you want to keep, and get it all on 1 machine, and do these steps on that 1 machine02:32
The_Blode left02:33
hbautista joined02:35
bn_work right, I'm aware git tracks the entire state of the repo during a commit, re. "branches": regardless of what the underlying representation is (a pointer to just a head commit or chains of commits), isn't the diff in re. to my question moot? I was asking if there are effectively 3 "branches" now since there are 3 vertical lines? or were? (the last one seemed to merge them all together?)02:36
I don't know how I would "get it all on 1 machine"? besides copying it out...?02:38
rewt commit + push, then fetch on the other02:39
bn_work I'm assuming I should do this because it would overwrite those files when I pull back on machine2 after fixing it on machine1?02:39
rewt yes02:39
you'll do a reset on the other one at the end, which could lose those files/changes02:39
bn_work so were the 3 vertical lines master, remotes/origin/master, remotes/origin/HEAD -> origin/master ?02:41
could I not just stash & pop it back on machine1?02:41
er.. 202:41
rewt you could, if you're comfortable with that02:42
jclsn left02:43
roadie joined02:44
bn_work ok, so on machine1, I did `git branch oldmaster`. PS: `I'm still very confused with what "branches"/lines-of-ancestry/whatever-is-the-correct-term of what those 3 lines were?02:46
rewt there is no git term afaik for those lines... they simply indicate that the commit where 2 lines meet is a merge commit with 2 parents02:47
bn_work rewt: so now git checkout oldmaster and rebase -i there? or rebase on master now that oldmaster has "backed up" current HEAD?02:47
rewt so right where you are, `git rebase -i ab75188` will show an editor with a list of commits02:48
srinidhi left02:48
rewt oldmaster should be at the same commit as master; we can ignore it for now02:48
jclsn joined02:49
srinidhi joined02:51
bn_work yeah, I've rebased interactively before. One weird thing I just noticed though from the diff I did earlier of: "`git diff <parent>..<merge>` # replace <merge> with your merge commit, and <parent> with the parent you want to diff against", one of the lines shows as a deletion vs addition?02:51
rewt should that line not be deleted?02:53
austin987 left02:53
austin987 joined02:54
bn_work rewt: no, on machine2 (where that change originated from as 066c03c) it is an addition02:54
rewt what was the diff command you used?02:55
Murr joined02:55
bn_work wait, maybe I did it backwards, yes, sorry02:57
that's weird that only 1 of the 2 lines showed reversed02:57
rewt `git diff A..B` shows what changes are needed to get from A to B02:58
bn_work when I pop later on machine2, can I rebase it onto whatever it gets reset to?02:58
rewt yes02:58
bn_work how?02:59
roadie left02:59
rewt let's finish this part first02:59
bn_work and I guess I need to git stash -u too on machine202:59
ok02:59
gast0n left03:00
rewt so you're doing the rebase -i?03:00
bn_work yes03:00
on machine103:00
jclsn left03:01
bn_work ok, done03:01
it's linear now03:02
rewt ok, do that same git log command again, and pastebin the output ... if you want to hide the commit messages, you can add `--formmat=%h%d` on the end03:02
ghost43 left03:03
jclsn joined03:03
ghost43 joined03:04
bn_work rewt: https://www.irccloud.com/pastebin/0yynrBul/git%20log%20--oneline%20--graph%20--decorate_after_rebase_-i_ab75188_on_machine1.log03:05
Gustavo6046 joined03:05
rewt hmm... that's not what i was expecting03:06
bn_work ... :|03:06
tatuio left03:06
guest left03:06
rewt not showing oldmaster03:06
anyways... do you get any output for `git diff 48379aa..d370bc0`03:07
bloody left03:07
bn_work no03:07
rewt ok, that's good03:08
stenno joined03:08
rewt and all the commit messages are in the order you want? (newest on top in git log)03:08
bn_work I assume 48379aa is now oldmaster?03:08
geowiesnot left03:08
rewt yes, it should be03:09
bn_work I think so, it didn't show timestamp but as long as the original commit + messages are there (vs "merge commit foo"), I'm happy03:09
rewt yes, the original author info is the same as the corresponding commits03:09
so now you can force push it03:10
makoto2600 joined03:10
bn_work `git push -f`?03:10
rewt and then on machine2, you `git fetch`, then `git stash -u` as you said, then `git reset --hard origin/master` to reset that master to match, and the finally pop as you said03:10
yes03:10
bn_work so how I rebase when I pop?03:11
makoto2600 left03:11
rewt it will apply the stash to what you have checked out03:11
bn_work ok, force pushed03:12
rewt like a rebase, but no commit, so technically not a rebase in git terms03:12
stenno left03:13
jclsn1 joined03:13
bn_work uh, so what about the untracked files? PS: earlier today on machine1 I tried to stash pop (the same?) set of `git stash -u` files but it said `/foo/bar/baz already exists, no checkout` and then finally `error: could not restore untracked files from stash` (RC=1)03:14
FYI, machine1 was machine2 restored onto it a few months ago but it had diverged since.03:15
(new machine to replace slowly failing machine "2")03:15
jclsn left03:15
rewt if the pop fails, everything is still there in the stash; everything that could be applied should be applied (iirc), and you'd only have to manually check the files it complains about03:17
mannequin https://paste.debian.net/1235524/03:17
bn_work yes, the stash is still on machine1, I'm just wondering if the same will happen with machine2, and if so, how do I get it to apply those files?03:17
it basically complained about everything?03:18
rewt it's a fresh stash from 65efe9e, so it should apply cleanly, unless you did something in 8df9c3a that would cause a conflict03:18
jclsn1 left03:20
bn_work 8df9c3a was just 1 file with 3+, 2-03:22
srinidhi left03:24
bn_work ok, git stash -u completed03:24
`git status` on machine2 shows this: https://www.irccloud.com/pastebin/vEmd2Gbt/git_status.log03:25
jclsn1 joined03:25
rewt ok, the reset should align them03:26
saroy joined03:27
srinidhi joined03:27
bn_work hmm, why doesn't git log --online --graph --decorate not show origin/master, origin/HEAD?03:30
finn_elija joined03:31
FinnElija left03:31
finn_elijaFinnElija03:31
bn_work I think I understand why you were also confused about oldmaster not showing up as a pointer either now03:31
ghost43 left03:31
parsnip maybe try --all03:31
jclsn1 left03:31
bn_work (I assume that's what you were referring to earlier by the "not what I expected" comment)03:31
saroy left03:31
ghost43 joined03:31
rewt what if you add --all to the git log command03:31
parsnip (and iiuc, --decorate is redundant on newer git)03:32
bn_work parsnip: aha, yes!03:32
parsnip i just got back03:32
rewt wb03:32
parsnip nice, you got rebase -i to work03:33
is that mostly a matter of "skipping" the merge commits?03:33
ChmEarl left03:33
parsnip i'll try03:33
wait, rebase -i selects a linear path anyways, so no merge conflicts to skip?03:34
rewt yeah, it excludes the merge commits by default03:34
parsnip i wonder what order it puts them in. author date?03:34
rewt that's what i'm guessing03:34
parsnip as empty, i guess03:35
a merge conflict can result in non-empty merge commit?03:35
jclsn1 joined03:35
parsnip anyways, i went to wrong grocery store, going out again for more03:35
rewt it stops on a conflict, lets you fix, git add, and then continue03:36
`git status` gives instructions, as usual03:36
funhouse joined03:36
parsnip oh, that's interesting, i'll try it now03:36
this is even after a conflict was resolved? a rebase -i pauses?03:37
bn_work wow, that apparently worked!03:37
`git stash pop` that is03:37
parsnip like, i merge, conflict, resolve, finish merge, rebase -i, and it pauses for the conflict again?03:37
bn_work rewt: thanks a ton!03:37
parsnip w00t!03:37
bn_work (& parsnip too)03:37
rewt yeah, parsnip, it pauses on each commit that has a conflict03:38
tyson2 left03:38
bn_work ok, *phew*, glad I'm back to normal.03:38
So moral of the story, change default merge strategy to... rebase?03:38
parsnip or fast forward only03:38
iiuc03:38
i always fetch first, but i'm silly03:39
rewt `git pull --rebase` (it's not quite the same as a `git rebase`)03:39
parsnip i fetch, review, and decide03:39
rewt same here, git fetch, git status, then may git pull --rebase03:39
parsnip looking at --graph03:39
rewt maybe*03:39
parsnip --all03:39
Codaraxis_ joined03:39
parsnip i mostly use git from magit, so all my muscle memory03:39
jab416171 left03:39
parsnip everything looks like a nail. i have very few workflows that work for lots of cases03:40
i constantly am looking at the graph log, use interactive rebase a lot, and create temporary branches quite a bit03:40
jclsn1 left03:41
rewt same (except for gitk instead of graph log, but same thing in the end)03:41
leib joined03:41
bn_work oh EMACs, ugh, heh03:41
rewt hah, i wasn't gonna say it :D03:42
bn_work rewt / parsnip: so should I do `git config pull.rebase true` and how do you review once fetched but before pulled?03:42
parsnip lol03:43
bn_work do you just do a git diff against the HEAD of master?03:43
Codaraxis left03:43
parsnip replace git pull with git fetch03:43
i use my GUI graph all to show me the diff for each node on the graph03:44
i can move point on commit, and the other window shows the diff03:44
you could do a diff03:44
but usually i can see the difference, like noting that my branch has changes at a completely different file or file location, and decide to rebase03:45
leib left03:45
bn_work I guess the whole point of splitting it like that into two operations (fetch + pull) is to not be shoved into having to resolve merge conflicts?03:45
parsnip i can use my GUI to select two commits on the graph, and see the diff03:45
my CLI git-fu isn't not super hot03:45
jab416171 joined03:45
parsnip *is not03:45
yeah you can decide what to do after fetching03:46
jclsn1 joined03:46
parsnip if you just did git pull and got conflict, it shouldn't be hard to reset locally03:46
rewt pull is just fetch+merge, so doing fetch first lets you look at things before doing the merge03:46
parsnip assuming you wanted to reconsider as if it was a fetch03:46
yeah, you have like no prior information to plan, if you do git pull03:46
srinidhi left03:47
parsnip fast foward only might be interesting03:47
bn_work so should I set `git config pull.rebase true` so I don't wind up in this again? I'll try to remember to just do `git fetch` from now on, but I assume I would still then need to figure out how to merge/rebase?03:47
rgrinberg joined03:47
parsnip then it only automates the merge in the nicest case03:47
pull.rebase true is okay, at least it would take you in direction of linear attempt03:48
but it's not fast forward only03:48
iiuc03:48
and yes, trying to prefer git fetch is fine too03:48
bn_work parsnip: yeah, right now it's just me but 2 machines (I'm trying to not touch the same areas to avoid conflicts), another advanced dev recently pushed a branch in a completely different area (I'm assuming I'll need to tell him to re-pull after my force push)03:48
parsnip oh dear03:49
bn_work parsnip: yeah, that's not a bad idea, I assume all mine were FFs since there were no conflicts?03:49
parsnip we didn't know we were advising on a repo that was already being shared03:49
make sure the force push is okay with team03:49
srinidhi joined03:49
parsnip no, a "divergent merge", i think that's separate from "fast forward only"03:50
you had several overlapping divergent merges03:50
bn_work he made his own branch03:50
parsnip fast forward only, is like when your commits are an ancestor of the fetched HEAD03:50
so merge just fast forwards03:50
bn_work parsnip: well, I mean, my changes could have been FF-ed?03:51
I did?03:51
parsnip okay, if you merge his branch, it will have the old divergent merges as an ancestor?03:51
rewt bn_work, where did you base his branch on?03:51
or where did he* rather03:51
parsnip good question ^03:51
bn_work parsnip: no, he branched way before03:52
parsnip platta2: if there is a divergence between your local branch and the remote branch, that means your local branch is not an ancestor of remote branch03:52
platta2: sorry, i meant bn_work03:53
rewt if he branched from ab75188 or a16b6eb, it's ok, otherwise he'll re-introduce divergence(s)03:53
parsnip if your local branch is not an ancestor of remote branch, then "git pull and merge only if fast forward" will fail03:54
rewt so if his history includes 8397889 or 7edfe48, that's bad03:54
bn_work parsnip: right, I think I see what you're saying now, basically it's only for workflow where you don't commit and only pull?03:54
workflows03:54
rewt: wait, why would him branching way before the commits all this happened, reintroduce this?03:55
parsnip it's for many workflows, but it will more often force you to review after "git pull", rather than trying to enter into a divergent merge or rebase or a conflict03:55
him not branching way before03:56
rewt if he branched from one of the first commits that the rebase -i didn't change, it's good; if he branched from one that got rebased, he'll re-introduce the original commit03:56
eroux left03:57
parsnip if his branch is a descendant of your divergent merges, then work will have to be done to remove those03:57
in other words, you changed shared history, and that is to be avoided, and would not have to be carefully discussed with them and handled03:57
Batman__ joined03:57
bn_work he branched from a commit way before this diverged in ab75188 happened, so isn't he ok?03:58
s/in/after/03:58
parsnip they'll have to fetch your changes, then consider the graph, is one way to look at it03:58
sounds good03:59
TheCatBehemoth joined03:59
rewt the easiest way to solve it is for him to `git fetch`, and then `git rebase origin/master` ... that should leave his branch with only the commits he made in his branch03:59
parsnip hopefully the "common ancestor" is a commit before where the rebase occurred.03:59
rewt but yeah, if he made the branch before ab75188, he's ok03:59
parsnip that sounds good. here's another idea, not sure if it sounds super complicated04:00
:04:00
rewt the CA will have to be on the current linear history, so a rebase will eliminate any of the commits that were rebased here, leaving his branch with only his commits04:01
parsnip have them fetch your origin/master, create a temporary branch at current local master, rebase that temp branch onto origin/master, push that temp branch, now you can fetch it and make sure everything looks good04:01
rewt (if all the changes in a commit are already present, that commit is removed during the rebase)04:01
parsnip oh, you mean the rebase might work even if it had the divergent merges?04:02
rewt yea04:02
parsnip that makes sense, i hadn't thought of that04:02
TheCatBehemoth left04:03
rewt it is possible to force an empty commit at that point, but that's not default04:03
bn_work CA?04:04
commit ancestor?04:04
rewt yes04:04
no04:04
common ancestor04:04
the last commit that's in both branches' histories04:05
parsnip i've used divergent merges almost never04:06
bn_work empty commit?04:07
rewt a commit with no changes04:08
bn_work didn't know that was possible...what is the purpose of that?04:08
you mean like a tag?04:08
sa0 joined04:09
rewt no, an actual commit, same as any other, but no diffs from the previous one04:09
a tag, like a branch, is just a pointer to a specific commit04:09
bn_work right, I was just trying to think of when a commit would be empty, but I guess it's not really a commit to begin with?04:10
parsnip i like my "First commit" to be empty04:10
i'm silly04:10
sometimes you can use it as a reminder04:10
ghost43 left04:10
parsnip it is a commit04:10
just, sort of a trivial one04:10
fsvo "trivial"04:10
structoha left04:10
Sulky joined04:10
parsnip it might be the initial commit in the category of commits /s04:11
it's "useless"04:11
ghost43 joined04:11
parsnip hence why git prevents it by default04:11
you have to say, "no i'm serious, i really want an empty commit"04:11
rewt maybe you have a CI/CD system that triggers on commit, and you want to re-trigger it, but don't want to make any changes04:11
ghost43_ joined04:15
roadie joined04:17
parsnip A commit is not just a worktree (diff). So it not only contains the state of the worktree, which can be "trivially" the same as its parent, but it also records who the parent is, the author and committer information, the commit message and the hash of all of that.04:17
ghost43 left04:17
parsnip well, and parent can be empty too, for initial commits04:18
(you can have more than one initial commits, something not well indicated by some graphs)04:18
i can't remember if you can create a commit that has no author or committer. maybe not with git porcelain.04:19
rewt interesting... if you want to change the author of a commit, it won't let you use a blank, and if you use something that partially matches a previous author, their name+email is used04:26
chenqisu1 left04:27
DoofusCanadensis left04:28
roadie left04:32
zebrag left04:34
sa0 left04:39
_xor joined04:43
pulse left04:52
madewokherd` joined04:53
madewokherd left04:57
pyeverything joined05:00
pyeverything left05:01
luke-jr left05:04
roadie joined05:06
ghost43_ left05:07
ghost43 joined05:08
luke-jr joined05:08
madewokherd` left05:08
vysn left05:09
roadie left05:10
madewokherd joined05:12
roadie joined05:17
sudoforge left05:17
srinidhi left05:19
srinidhi joined05:20
roadie left05:21
madewokherd left05:22
ghost43 left05:22
ghost43 joined05:23
humanBird left05:25
ferdna joined05:27
saroy joined05:29
Hash Hi05:35
I worked on something all day, then I had a bug, so I did `git stash` and it stashed it and reverted to head, and bug went away05:35
structoha joined05:36
Hash Now I need to do a diff of stuff in stash and stuff in head, so see what I did.05:36
What should I do, I read all the docs for git-stash05:36
https://git-scm.com/docs/git-stash05:36
I am in my testing branch. Should I `git stash apply` and commit this broken code, and so history is saveD?05:37
What is the best method in your opinions?05:37
roadie joined05:38
rgrinberg left05:39
parsnip i'm not #git pro, but `git stash apply` sounds good to me. although i rarely use stash, i usually use magit to apply05:42
Hash Yeh I know you from #emacs05:42
I am using cli05:42
parsnip you could also convert it to a branch05:42
:-)05:43
The_Blode joined05:43
Hash thanks for reply, I'll check out stash apply and then commit them to a commit. You can always revert or do something else. I don't want to lose the changes. I could put them into a testing-2 branch or 'bugged' branch05:43
so git stash apply, get my stash back. Then git branch newbranch and the changes should go into a new branch right?05:43
Or if I git stash apply, then just commit to 'broken commit'05:44
So at least it's in history05:44
parsnip i guess stash just has extra features, like effectively saving index and working tree both05:44
Hash Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.05:44
... and restored (potentially on top of a different commit) with git stash apply05:44
parsnip i imagine theoretically, you could commit the working tree and index as separate commits05:45
structoha left05:45
Hash Calling git stash without any arguments is equivalent to git stash push <- that's what I did. push05:45
parsnip er, reverse, index, then working tree, sounds intuitive to me05:45
yeah they sort of act as generalized patches i guess05:45
rgrinberg joined05:45
parsnip and, so like a stack of stashes i guess05:46
Hash pop: Remove a single stashed state from the stash list and apply it on top of the current working tree state, i.e., do the inverse operation of git stash push. The working directory must match the index.05:46
apply doesn't remove it05:46
parsnip i guess it's a stack because it's not a graph05:46
Hash pop removes it05:46
parsnip yeah, i usually use apply until i'm sure i'm done with it05:47
i guess stash is good if you really have to switch tasks quickly05:47
Hash git stash branch bugged_branch stash@{0} ?05:48
trying to get the syntax right05:48
https://opensource.com/article/21/4/git-stash05:48
A practical guide to using the git stash command05:48
parsnip that looks right. i wonder if there's a happy medium on documentation, somewhere between git's dry man pages, and something like a usage article05:50
Hash if you do git stash apply05:50
parsnip https://git-scm.com/book/en/v2/Git-Tools-Stashing-and-Cleaning05:50
Hash How do you reverse it?05:50
I did git stash, then git stash apply to get it back, then now I want to stash it again05:51
I didn't pop, so it's sitll in git stash list05:51
But it's been applied. How do I unapply it?05:51
parsnip oh, you want to add a stash@{1}?05:51
i mean, push to the stack?05:51
Hash No05:51
1) git stash05:51
2) git stash apply <- to get stash0 back05:52
parsnip oh, intuitively, i'm guessing you can just reset the branch ref05:52
Hash 3) Now I want to undo #205:52
parsnip reading...05:52
roadie left05:52
ikke git stash apply applies a stash without dropping it05:52
Hash correct05:52
parsnip yeah, it sounds like you wouldn't lose anything if you "removed" the apply05:52
but so i want to read what apply does exactly05:52
Hash Now that the stash been reapplied again, if I wanted to get rid of those chagnes, what would I do?05:52
ikke afaik, there is no way to just unapply what you just stashed05:52
parsnip apply moves the branch ref?05:53
ikke no05:53
Hash Nothing happens to branch or head05:53
ikke it's a worktree operation05:53
parsnip no they applied it05:53
Hash just locally it creates a working tree copy adn puts changes there05:53
ikke git stash show -p stash@{0}05:53
parsnip they stashed, then applied, they want to undo the apply05:53
Hash ^ correct05:53
Just for learning purposes05:53
I want to get my HEAD back, but keep the stash05:54
parsnip hmm, if you had unsaved changes in worktree, and tried to apply a stash, would it reveal conflict?05:54
ferdna left05:54
Hash So like you stash, then apply, then what do you do if you want to get rid of the changes again?05:54
ikke Hash: if you did not have any other changes, the easiest would be to just reset your worktree05:54
parsnip reset worktree to index?05:54
ikke otherwise, you could try to apply the inverse of the stash05:54
parsnip but what if you had modified the worktree inbetween stash and apply?05:54
Hash Well stash is currently applied05:55
So how about we just create a new branch05:55
put the broken changes in there05:55
so at leat my testing branch which is bug free is clean.05:55
parsnip make sure working tree and index don't have unsaved items before applying05:55
what i would probably do ^05:55
R2robot left05:56
parsnip how do you apply the inverse of a stash?05:56
hmm, `git apply -R <patch>`?05:56
so you need the patch from the stash05:57
but still05:57
yeah usually what i do, is i clean working tree and index, then apply the stash, then commit the index as one commit, and the working tree as as a second commit05:57
imo, that's a faithful representation of the stash05:58
and give it a clever branch name, like `faithful/stash/0`05:58
Hash well, right now the stash is applied. So should I just create a new branch from these changes05:59
or use git stash branch command?05:59
If I don't commit, and do git branch testing2, it should put all my uncommited changes in that branch right?06:00
parsnip i already know how to make a branch and make commits from an index and working tree, so that would be my first reaction06:00
Hash Ok so I should do that too06:00
Right now the stash is applied, and git status shows lot of modified files06:01
parsnip roughly, i'd have to review if `git branch foo` checks that branch out06:01
Hash So now I can do git branch testing-206:01
Gustavo6046 left06:01
parsnip is there only changes in index, or only changes in working tree, or both?06:01
Hash you switch branches with git checkout branchname06:01
Gustavo6046 joined06:02
Hash you crate branch with git branch newbranch06:02
Taht's why I use cli mostly cuz if you use gui and or magitt etc. you don't get to learn git06:02
once I larn it, then guis are okay to use06:02
parsnip right, i agree, i've gotten myself into this mess, using the GUI06:03
Gustavo6046 left06:04
parsnip but i still know more about git than the average non computer user ;-)06:04
Gustavo6046 joined06:04
Hash That's true06:05
you're awesome :)06:05
So what if you have uncommited changes, and you want to put those changes into a new branch06:06
The data is saved on disk already but not commited06:07
I don't want to put these bugged code into the original branch06:07
I'm trying to find out if when you create a new branch, does it copy your uncommited changes to that branch? Or how does it do?06:07
parsnip iiuc, commits go towards movement of the checked out branch ref06:08
iirc, almost all git commands only move the checked out branch ref06:08
i had some weird mnemonic like this06:08
ikke uncommitted changes do not belong to any branch06:08
they just remain in your worktree06:09
Misotauros left06:09
Hash git checkout -b newBranch06:09
parsnip like, even merge06:09
Hash then commit06:09
I got it06:09
parsnip when you merge two branches, the checked out one is the one that moves06:09
Hash https://stackoverflow.com/questions/13687334/moving-uncommitted-changes-to-a-new-branch06:09
ghost43 left06:10
ghost43 joined06:11
ikke !float06:11
gitinfo If you have made a change in your working directory and have NOT YET COMMITTED, you may "float" that change over to another (`git checkout existing_branch`) or new (`git checkout -b newbranch`) branch and commit it there. If the files you changed differ between branches, the checkout will fail. In that case, `git stash` then checkout, and `git stash apply` and go through normal conflict resolution.06:11
parsnip it is kind of cool that you can create a new branch and check it out, with uncommitted changes, as long as it is at current commit06:13
great_taste left06:16
igemnace well if you think about it, you're really only changing HEAD in such a case. no need to touch the work tree06:16
peepsalot left06:16
Hash Ok06:17
Broken code is now in testing-2 branch06:18
Now I can see the diff visually and see what changed from previous commit that caused the problem.06:18
To only today's work is bugged. Yesterday's commit works on `testing`. testing-2 is broken code.06:18
So I will have to debug that tomorrow.06:18
If I can't figure it out, start over in testign branch from new on these new features06:19
I lvoe git.06:19
I wouldn't know what I would do without it06:19
How did we ever use CVS and SVN06:19
R2robot joined06:20
Murr left06:20
Murr joined06:20
parsnip i never did06:23
stenno joined06:25
dodo meh, has somebody noticed that bash completion from upstream git-completion.bash completes remote names and ignores local paths? that's not something i want..06:26
ghost43 left06:29
ghost43 joined06:30
feriman joined06:32
TheCatBehemoth joined06:41
TheCatBehemoth left06:46
chenqisu1 joined06:48
carl-- joined06:52
GNUmoon left06:57
chexum joined06:57
robink joined07:05
pizdets joined07:05
ghost43 left07:06
ghost43 joined07:07
rgrinberg left07:07
rgrinberg joined07:08
vysn joined07:12
zeenk joined07:14
rgrinberg left07:15
Akiva left07:16
wonko-the-sane left07:18
stenno left07:19
EvilDMP joined07:20
roadie joined07:22
wonko-the-sane joined07:28
kaiseisei left07:28
kaiseisei joined07:30
kaiseisei left07:32
kaiseisei joined07:33
wonko-th1-sane joined07:33
wonko-the-sane left07:34
kaiseisei left07:35
TheCatBehemoth joined07:35
kaiseisei joined07:36
geirha I write my own completions, but it may be it will complete paths if it07:40
if it's after a -- argument07:41
howdoi left07:41
hbautista left07:42
yosef[m]1 joined07:44
Deknos left07:45
Deknos joined07:45
geirha ugh, 3.5k lines. I'm not going to bother to go through that. Seems like over-engineering07:46
stenno joined07:47
kaiseisei left07:48
dionysus69 joined07:48
geirha anyway, you could also try starting the path with ./; it will likely switch to filename completion then07:48
kaiseisei joined07:49
Gustavo6046 left07:49
Gustavo6046 joined07:49
kenanmarasli joined07:50
kaiseisei left07:55
kaiseisei joined07:56
mattil joined07:57
PaterTemporalis left07:57
kaiseisei left08:00
germ left08:00
germ joined08:00
rfuentess joined08:02
kaiseisei joined08:03
kaiseisei left08:04
The_Blode left08:06
kaiseisei joined08:06
NeilRG joined08:07
NeilRG do I need to use a personal access token with github everywhere now?08:07
The_Blode joined08:07
geirha using ssh keys is easier imo08:08
ghost43 left08:09
ghost43 joined08:09
Deknos left08:10
palasso joined08:11
NeilRG geirha, good idea, so I just clone using the ssh link?08:12
parsnip yes08:12
assuming you followed steps that GitHub provides to configure public key08:13
NeilRG parsnip, okay thanks08:13
parsnip GitHub has pretty good docs for various aspects of setup08:13
NeilRG I was using git://, but now it won't let me08:13
so I'm switch to ssh08:13
Batman__ left08:14
Batman__ joined08:14
GNUmoon joined08:15
geirha git remote set-url origin [email@hidden.address]08:16
wonko-th1-sane left08:18
l4s8g joined08:19
NeilRG geirha, thanks!08:20
geirha, that's useful. I ended up deleting and re-cloning08:21
kaiseisei left08:21
kaiseisei joined08:22
ghost43 left08:24
ghost43 joined08:25
km joined08:29
km left08:29
caverton joined08:32
alip joined08:33
matthewcroughan left08:33
matthewcroughan joined08:33
skapata left08:36
iokill joined08:36
sa0 joined08:36
km joined08:36
jimklimov left08:37
carl-- left08:43
warblr joined08:45
Gustavo6046 left08:46
Gustavo6046 joined08:46
otisolsen70 joined08:46
NeilRG left08:51
xylz joined08:52
kaiseisei left08:53
Haohmaru joined08:53
km left09:00
km joined09:01
reset joined09:02
keypusher joined09:09
duxsco joined09:09
sa0 left09:10
ghost43 left09:12
ghost43_ joined09:12
warblr left09:13
keypusher left09:14
austin987 left09:18
ghost43_ left09:19
austin987 joined09:19
menace joined09:19
menace left09:19
menace joined09:19
menaceDeknos09:20
ghost43 joined09:21
duxsco left09:22
Anticom joined09:24
Anticom Hi folks. Let's say I've tagged releases 1.0.0, 1.1.0 and 2.0.0 on my main branch. Now I'd like to release a patch for 1.1.0 as 1.1.1. What are the best pratices on managing this (via branches presumably)? Are there multiple options to do this or is there just "one" good way? How would I name such a branch?09:26
roadie left09:27
cart_ joined09:28
kaiseisei joined09:28
ikke Anticom: a project I work on typically uses stable-x.y branches09:30
Anticom ikke: So I would branch off of 1.0.0 with a `stable-1.0` branch and also tag my 1.1.1 release in there?09:31
ikke yes09:31
Anticom Nice, thanks!09:31
geirha I'd branch off 1.1.0 with stable-1.1 and then tag 1.1.1 in there09:31
ikke oh, right09:32
1.1.1 would be in the stable-1.1 branch09:32
If 1.0 would also need to fix, you'd cherry-pick the change to there09:32
feriman left09:35
feriman joined09:36
jimklimov joined09:37
roadie joined09:42
mannequin left09:43
Anticom Err yea of course, small hickup on my side. Of course it's gonna be stable-1.1 :) Thanks for the heads-up guys09:44
roadie left09:46
roadie joined09:46
nyah joined09:50
feriman left09:50
srinidhi left09:55
madewokherd joined09:55
CalimeroTeknik can several signatures be added to a commit?09:56
as signoffs I mean09:57
xkuru joined09:58
azed joined09:59
ghost43 left10:02
ghost43 joined10:02
tulpa_ joined10:05
ikke yes10:09
chenqisu1 left10:13
cart_ left10:13
vishal left10:15
AbleBacon left10:16
srinidhi joined10:16
vishal joined10:18
jazzy2 left10:18
dslegends joined10:20
Murr left10:20
Murr joined10:20
zumba_addict left10:22
l4s8g left10:24
xylz left10:25
ghost43 left10:30
CalimeroTeknik even after the commit is made, someone can say "I validate this" (possibly with PGP)?10:30
haskl left10:30
tyson2 joined10:31
ghost43 joined10:31
CalimeroTeknik because I'm not finding any tutorial to even tell whether it exists10:31
haskl joined10:33
CalimeroTeknik it seems to me as though unless you are creating a commit, you can't add a signature to it10:35
canton7 Yeah, commit signatures are added to the commit itself, and commits are immutable. You can of course create a tag which has a signature and which points to a commit10:37
CalimeroTeknik got it, indeed that will work then, to signal someone says "this is okay"10:37
man git review mentions that10:38
gitinfo the git manpage is available at https://gitirc.eu/git.html10:38
canton7 Ah, you're talking about Signed-Off-By, rather than a PGP signature. Same deal: that's just a line in the commit message10:38
CalimeroTeknik no, I also discovered that git had this notion called signed-off-by, indeed, but I don't mean that (after all it's just a facility to add text to the message as you say)10:38
canton7 Ah, right10:39
CalimeroTeknik so, the way is to create a signed tag then10:39
ikke Because you mentioned 'as signoffs', I assumed you beed signed-off-by10:39
canton7 Yeah signing individual commits has questionable benefit: the normal way is by signing the release tag. That ensures that neither the commit being tagged nor any of its parents can be tampered with10:39
ikke meant*10:39
CalimeroTeknik has anyone ever raised the issue of needing several signatures on the release tag? if say, it needs the approval of 2+ maintainers10:41
keypusher joined10:41
otis^ joined10:42
azed left10:43
srinidhi left10:44
kaiseisei left10:46
srinidhi joined10:46
xylz joined10:48
hongkongliberato left10:58
toulene3 joined11:00
hongkongliberato joined11:00
ghost43 left11:00
The_Blode_ joined11:00
DibbTubberOne joined11:01
ghost43 joined11:01
The_Blode left11:01
toulene left11:01
toulene3toulene11:01
canton7 CalimeroTeknik, signatures are about internal approvals - they're a way for people who clone the repo to ensure that noone's tampered with it11:01
zer0bitz joined11:02
canton7 CalimeroTeknik, if you're worried about internal approvals, that's normally done with other tooling. E.g. you might be using github/gitlab, which enforces that branches can only be merged to main after they pass code review, and that a code review needs 2 approvals from <group> before it can be merged. Equally, you may only be allowed to merge to11:02
the production branch with the appropriate number of approvals. That sort of thing is nicely handled outside of git itself11:02
srinidhi left11:04
stenno left11:05
zeenk left11:07
CalimeroTeknik external metadata indeed. but the signable tags are quite good already11:07
sa0 joined11:07
Andy_Kw joined11:08
xylz left11:10
wonko-the-sane joined11:11
stenno joined11:14
wilz left11:15
dob1 is stash indipendend from the branch ?11:16
parsnip i believe so11:18
it's sort of like a pair of related diffs11:18
hmm11:18
git represents diffs as working trees?11:19
srinidhi joined11:19
parsnip but consider that the stashes are a stack, not a graph like you see in git log --all --graph11:20
so you accrue them, like a stack, but each stash is sort of independent of the commit graph11:20
and branches are just pointers to commits in the commit graph11:21
thiago joined11:22
Rashad joined11:24
parsnip i think it's implemented in terms of the commit that your branch ref pointed to11:24
GNUmoon left11:24
GNUmoon joined11:25
dob1 parsnip, I was thinking for example if you delete the branch where you create the stash, what happen if it is a diff ? it has to be "recalculated"11:26
ikke dob1: commits are not diffs, they are snapshots11:26
parsnip but it behaves somewhat like other commits. you can try to apply it elsewhere, which might be comparable to rebasing. it may work fine, or there may be conflicts11:26
ikke so git _always_ calculates the diffs11:26
and if you delete the branch, it's just a pointed that you delete11:26
the history is still there, and kept alive by the stash11:26
a pointer*11:26
hongkongliberato left11:26
cart_ joined11:28
dob1 "the history is still there" because the stahs exists, when the stash is clear/pop/drop the history of the deleted branch will be gone?11:28
ikke dob1: not immediately, but eventually11:28
parsnip ikke: but you have to be _at_ some commit to apply the stash, and if you're no longer at the commit that branch was at, then stash apply will be like rebase11:28
lgc joined11:28
ghost43 left11:29
ghost43 joined11:29
dob1 ikke, eventaylly ? this means that if I delete a branch (that is not merged in another) I cannot be sure the data are gone?11:31
I didn't understand this11:31
ikke correct, git uses garbage collection11:31
because git needs to make sure the history is not referenced by other refs11:31
and the reflog will keep things alive for at least 90 days11:32
So, there is no dirrect command to directly delete commits11:32
iomari891 joined11:32
rsx joined11:33
dob1 this is not a problem if someone for example commit as error some secret data?11:33
vimal joined11:34
Rashad left11:34
ikke That is a potential issue. git does give tools to deal with that, but you need to make sure there is not a single reference left11:34
But if you pushed it to github for example, you have no control over when objects are cleaned up11:35
DibbTubberOne left11:35
dob1 it's not simple...11:36
lgc left11:36
ikke No11:36
tulpa_ left11:37
xylz joined11:37
funhouse left11:37
dob1 "git uses garbage collection" why there is not a command to force it?11:37
ikke git gc11:38
(or git maintenance run, nowadays)11:38
but, like I said, you need to make sure there are no references left11:38
you can use git reflog --expire-unreachable to get rid of reflog entries that point to unreachable history11:39
git reflog --expire-unreachable=now11:39
or git reflog --expire=now to expire all entries11:39
dob1 I take a not of them, thanks11:40
*note11:40
sa0 left11:40
mackerman All of this is just in your repo. If you collaborate with others and have pushed, you have to make them do similar cleanup on all copies of the repo.11:41
ikke Yes, good addition11:42
hongkongliberato joined11:42
very_sneaky left11:43
dob1 It's something that I was not aware11:44
I was thinking branch deleted -> gone, but it's not11:44
jaggz joined11:45
very_sneaky joined11:45
jaggz How do I merge these last two commits, so they have just the "Added instructions..." title?11:45
https://github.com/jaggzh/mumble/commits/doc-details-debian/docs/dev/build-instructions/build_linux.md11:45
Mumble project desires my pull request be a single commit11:46
(but I edited build_linux.md after the fact, through the web)11:46
Rashad joined11:55
Anticom jaggz: well commits pushed to a remote _should_ be considered immutable anyways, but if you really wanted to probably squash them interactively and force push11:56
bertvvvs joined11:56
hongkongliberato left11:57
xylz left11:57
ghost43 left11:58
ghost43 joined11:58
shan joined12:01
Anticom s/squash/rebase12:01
jaggz Anticom, hmm.. I used someone's instructions with reset --soft12:02
git reset --soft HEAD~312:02
PaterTemporalis joined12:02
jaggz then my push said I needed to pull changes12:03
Anticom Well that would work as well I suppose12:03
Yes, because git doesn't know you undid some commits in your working copy and hence assumes you'd want to pull in the changes that live on the remote12:03
ghost43_ joined12:03
jaggz hmm12:04
ghost43 left12:04
jaggz Anticom, how do you make it go through without the pull?12:05
somehow I'm down to like 10 commits in my local git log, and 2 showing in my branch on github :/12:05
Anticom make what go though? You have your repo on the remote (github) and in your working copy locally on your machine. If you really want to rewrite the commits on the remote you'd have to force push12:06
Well then you messed something up big time it seems12:06
dionysus69 left12:06
jaggz got it!12:06
one commit showing in github12:07
oh, and in local too.12:07
I had all the commits showing locally, I think, because I kept pulling in the remote changes after resetting and .. doing stuff.12:07
ugh.. no.. I've included tons of their changes in my one simple document change.. ugh12:08
Showing with 865 additions and 762 deletions.12:08
reset too far back maybe12:08
hongkongliberato joined12:11
csm3105 joined12:15
Anticom Probably12:16
synthmeat joined12:21
mannequin joined12:21
cart_ left12:28
bloody joined12:31
cart_ joined12:38
perrierjouet joined12:41
Rashad left12:49
srinidhi left12:49
xkuru left12:50
Maxattax joined12:53
xkuru joined12:56
stenno left12:56
cart_ left12:57
Xenguy left13:01
sudoforge joined13:01
XV8 left13:02
XV8 joined13:03
Rashad joined13:04
gdd joined13:06
srinidhi joined13:07
cart_ joined13:10
srinidhi left13:18
cart_ left13:20
cart_ joined13:21
l4s8g_ joined13:21
ghost43_ left13:21
ghost43 joined13:21
vysn left13:23
cdown joined13:24
stenno joined13:25
csm3105 left13:26
dionysus69 joined13:29
l4s8g_ left13:30
lukedashjr joined13:30
dionysus70 joined13:30
luke-jr left13:33
lukedashjrluke-jr13:33
dionysus69 left13:34
dionysus70dionysus6913:34
sa0 joined13:38
stenno left13:39
warblr joined13:53
ghost43 left13:53
ghost43 joined13:54
tatuio joined13:59
ghost43 left14:00
ghost43 joined14:03
cdown left14:06
tyson2 left14:08
caveman joined14:09
otis^ left14:10
sa0 left14:10
mattil left14:16
anddam howdy, I have a list of commits A--B--C--D--E--F--G and I want to create A--G' where G' has all the squashed B .. G commits14:19
I figured I could do this by checking out A and then merge --squash G14:19
regedit joined14:20
regedit hello14:20
ghost43 left14:21
ghost43 joined14:22
regedit is there some way to split current changes into different patches or commits or branches?14:22
for ex. i did a bunch of changes now in working tree but i realize 50% of them are 1 topic and 50% are another topic, i wanna go through them hunk by hunk and divide them into different commits/patches/branches or whatever makes sense14:22
anddam my issue is I had conflicts, whereas I expected --theirs to just "win the race" in conflics14:22
x/conflics/ c/conflicts/14:22
roadie left14:22
osse if you get conflicts then the history isn't so linear you claim it is14:23
anddam osse: it is not14:23
osse: and this is a different repo14:23
osse anyway, you can git reset --soft A && git commit -m "Mega G'"14:24
regedit: use git add selectively before committing14:24
anddam this is a branch intended to be "public" opposed to the internal one, so I need to create a single "Mega Blob Message" commit on top of it14:24
osse: the reset after the conflicting merge or from a clean status in A?14:25
moldorcoder7 left14:25
regedit osse: git add is on a file level tho? how do i git add on a line-by-line (hunk by hunk? cherry pick?) level14:25
anddam no, wait, reset --soft A means I should be in G14:25
osse regedit: git add -p14:25
otisolsen70 left14:25
regedit ah very cool lemme look into that14:25
thx14:25
tatuio left14:26
regedit how do i "safely" revert any git adds back to unstaged (but not lose any edits!...)14:26
osse git reset (-p)14:26
anddam: yes, clean state at G14:26
regedit ah wow it also has -p coooool14:26
The_Blode joined14:27
anddam osse: that moves G ref to A14:28
The_Blode_ left14:28
regedit is there a way to git stash only what is staged or what is unstaged?14:28
osse anddam: It move HEAD from G to A, yes14:29
m5zs7k_ joined14:31
moldorcoder7 joined14:31
tyson2 joined14:31
m5zs7k_m5zs7k14:31
on^ joined14:31
anddam no, it moved the "label" G (forgive my lack of proper lingo) to point at the same ref of A14:35
osse ehh, sure14:36
I thought all those letters represented commit hashes14:36
anddam no, labels14:37
osse define label14:37
anddam "devel" and "master"14:38
refs ?14:38
osse sounds like branches to me14:38
so what is this, then: A--B--C--D--E--F--G14:38
are those seven branches?14:38
you even wrote "list of commits"14:39
stenno joined14:39
anddam no, that's me being bad at explaining, and understanding14:41
osse Let me draw up what I mean14:41
anddam I did mean those as commits, but used their currently attached branch names14:41
I just re-did the steps using G's tag and A remote (so no local branch) and it works as you said14:42
gast0n joined14:42
anddam I thought I could use either a commit or branch name, if they were the same _at that moment_14:42
bertvvvs left14:42
pulse joined14:44
hololeap left14:45
osse Could use either a commit or branch name where? If you mean this command: git reset --soft A then yes, you can specify the commit to reset to any way you want14:45
what is reset is the same in any case: the currently checked out branch14:46
hololeap joined14:46
roadie joined14:49
dvanloon4 joined14:50
dvanloon left14:51
dvanloon4dvanloon14:51
caveman left14:53
DoofusCanadensis joined14:58
roadie left14:58
srinidhi joined15:00
cambrian_invader joined15:04
_rgn hi osse, still using git-blamediff every day. o>15:06
zebrag joined15:07
roadie joined15:12
osse _rgn: nice!15:16
YellowSuB joined15:17
Misotauros joined15:17
roadie left15:18
szymon joined15:18
saroy left15:19
szymon left15:19
szymon joined15:19
sa0 joined15:20
szymon left15:20
ghost43 left15:20
ghost43 joined15:20
anaveragehuman joined15:21
ghost43 left15:24
ChmEarl joined15:24
tulpa_ joined15:24
davve any way to show a file in a given commit? (preferably just the contents)15:25
ghost43 joined15:25
vysn joined15:26
subopt joined15:26
rgrinberg joined15:27
osse davve: git show commit:file15:29
madewokherd` joined15:29
anddam I would have gone with git cat-file -p since I did now know show commit:files would work15:30
roadie joined15:30
anddam but osse's hint is way more handy15:30
hoochmonger left15:31
anddam osse: "Could use either a commit or branch name where? " <<< I mean that in my previous example I did "checkout devel" when devel was pointing at G, the "reset --soft A" moved devel from G to A. If I had done "checkout G" instead that would have been fine15:32
my confusion was that I could use either "devel" or "G" and that would not change anything15:32
madewokherd left15:32
stenno left15:34
osse ah15:34
tyson2 left15:35
moldorcoder7 left15:35
feriman joined15:36
geowiesnot joined15:38
moldorcoder7 joined15:41
roadie left15:41
Oblomov joined15:45
blaklistd0 joined15:45
awmv joined15:46
blaklistd left15:46
blaklistd0blaklistd15:46
wakeup joined15:48
wakeup I created a file in branch B. I didn't commit it. I switched to branch A. I still see the file in A. I don't want to accidently commit this file in A. So, how is there a way to make it "visible" only in B?15:49
AbleBacon joined15:49
osse no. either commit it (and amend that commit later) or use git stash15:49
wakeup git stash where?15:50
what does it do15:50
https://www.google.com/search?q=git+stash+meaning&oq=git+stash+meanin&aqs=chrome.0.0i512j69i57j0i22i30l7j0i390.2666j0j7&sourceid=chrome&ie=UTF-815:50
osse exactly15:51
justsomeguy joined15:51
wakeup after google rejected, I think I should stop using google search engine15:51
as if that would change anything for them15:51
osse is the file currently untracked?15:52
as in, the file is new15:52
wakeup yes it's untracked15:52
osse in that case I would use commit instead of stash, because stash with untracked files is a bit tedious15:53
imho15:53
caveman joined15:53
wilz joined15:56
wakeup but I don't want to commit it for now15:57
osse I get that15:57
You can amend that unwanted commit when you are ready to actually commit, or undo the commit when you switch back to B15:58
wakeup maybe I can just put it into the gitignore15:58
osse that won't remove it from disk though15:58
madewokherd` left15:59
pulse left16:05
stenno joined16:06
wakeup how would you stage only new files16:06
git add -A stages all files, new, modified, deleted16:06
justsomeguy left16:06
wakeup git add . stages modified and new files, no deletions16:06
I use this command usually to stage16:07
roadie joined16:07
wakeup but I should be more specific from now on16:07
and use the one that I really need16:07
osse I don't know of a direct way of staging only new files16:09
happens so rarely16:09
git add $(git ls-files --others --exclude-standard) I guess16:09
if your filenames are shell-friendly16:09
Sulky_ joined16:10
ghost43 left16:11
ghost43 joined16:11
m0viefreak joined16:11
Sulky left16:12
awmv left16:13
srinidhi left16:15
roadie left16:16
roadie joined16:16
caveman left16:16
R2robot left16:17
ghost43 left16:17
justsomeguy joined16:18
ghost43 joined16:18
geowiesnot left16:19
Murr left16:19
Murr joined16:20
roadie left16:21
madewokherd joined16:24
anddam I had a local annotated tag foo that I force updated onto remote from another repo, so when fetching my local tag stays at the old ref16:24
is there a way to "refresh" all tags according to a certain remote ?16:25
wakeup how would you merge 2 or more commits in git? these commits have already been pushed16:27
I think I did this once16:27
junktext joined16:27
anddam wakeup: you put yourself at a certain ref and merge the other16:27
"checkout" to check out a ref, "merge" to perform the merge16:27
pulse joined16:28
wakeup https://stackoverflow.com/a/61171280/392411816:29
fxrs joined16:30
wakeup git reset soft means?16:30
anaveragehuman left16:30
anddam I don't envy you16:30
bertvvvs joined16:30
wakeup hah?16:31
canton7 wakeup, !resets, https://git-scm.com/book/en/v2/Git-Tools-Reset-Demystified16:32
gitinfo wakeup: tl;dr of man git-reset: --soft moves HEAD, --mixed moves HEAD+index, --hard moves HEAD+index+work-tree, -- foo.txt will !unstage16:32
wakeup hah16:33
ok16:33
so basically we make the head detached16:33
tyson2 joined16:36
mthall left16:37
mthall joined16:37
rgrinberg left16:42
Jacques joined16:43
roadie joined16:44
iomari891 left16:44
Andy_Kw left16:44
R2robot joined16:44
vysn left16:45
masber joined16:46
regedit how do i cancel all changes/edits that have not been added/staged - anything staged should remain staged16:48
great_taste joined16:48
regedit cancel i.e. revert back to when everything was last added/staged16:48
howdoi joined16:49
justsomeguy left16:49
stenno left16:50
Rashad left16:51
Sulky__ joined16:53
cart_ left16:54
Rashad joined16:55
Anticom regedit: afaik only staged changes are stashed. So what I would do is stash the staged changes, then revert everything that remains and re-apply the stash16:56
funhouse joined16:56
roadie left16:56
Sulky_ left16:56
regedit i think my earlier question from about 1.5hr ago was about stashing. just now i was asking just about reverting changes that werent staged (which apparently is by git checkout -- .)16:57
er 2.5hr ago16:58
Anticom Well most of us aren't paid for hanging out in here but have work to do ;)16:58
regedit it's ok i think you thought i was commenting about you answering late. i was actually trying to clarify potential confusion between the previous question and most recent16:59
rfuentess left16:59
Anticom Ah i see :) Let me try to reproduce your scenario16:59
regedit oh thanks 🙏17:00
ghost43 left17:00
ghost43 joined17:00
Anticom Hm17:02
Hm looks like there's a way simpler solution: https://stackoverflow.com/a/52713/96653017:03
`git checkout -- . ` seems to do the trick for me17:03
however i don't quite know why17:03
masber left17:04
nedbat I can get GitHub pull requests locally with `git fetch origin pull/299/head:pr/299 && git checkout pr/299`, but then I can't pull to get more changes. I can do this: `git pull origin pull/299/head; git reset --hard FETCH_HEAD`, which works, but that last command seems really odd... What should I do instead?17:04
Anticom Probably does something similar to `git checkout HEAD <path_spec>`, however if I do `git checkout HEAD .`, everything is getting reverted17:05
And I didn't knew about `git restore` yet, so two things learned :)17:05
srinidhi joined17:06
sobkas joined17:07
masber joined17:07
Jacques left17:08
Anticom nedbat: have you consulted https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally ?17:08
Anyways gotta run, good luck guys!17:08
Anticom left17:09
PaterTemporalis left17:09
ChmEarl left17:11
tyson2 left17:11
osse anddam: git fetch origin '+refs/tags/*:refs/tags/*'17:12
ChmEarl joined17:13
osse actually no17:14
confused17:15
but deleting the tags works17:15
Jacques joined17:19
justsomeguy joined17:20
ghost43 left17:28
ghost43 joined17:29
skapata joined17:32
skapata left17:32
skapata joined17:32
zumba_addict joined17:36
feriman left17:41
anaveragehuman joined17:41
wakeup left17:42
XV8 left17:42
bindu left17:45
bindu joined17:45
Haohmaru left17:46
humanBird joined17:47
feriman joined17:47
m0viefreak left17:48
tulpa_ left17:51
Jacques left17:56
XV8 joined17:58
Misotauros left17:59
jnnnnnnnnn_ left17:59
jnnnnnnnnn joined17:59
Akiva joined18:04
ghost43 left18:12
ghost43 joined18:13
TheCatBehemoth left18:15
roadie joined18:17
Murr left18:20
Murr joined18:20
tyson2 joined18:21
ecraven joined18:23
masber left18:23
ecraven hello ;) how do I show the *Nth* commit in a branch? I found I can use `git rev-list --all --count` to see how many commits there were until now, but say I want to see the 19420th (or rather just get its commit hash)18:24
Misotauros joined18:24
ikke ecraven: this is only well defined if you number backwards (from the most recent commit in a branch backwards to older commits)18:25
rsx left18:25
ikke If that's what you want, then HEAD~N,18:26
justsomeguy left18:26
ecraven well, I want the 19420th commit on the current branch, so go back to the start, then count 19420 along.. is there a simpler way to do this than implement this (count backwards, then subtract to get N for HEAD~N)?18:27
rgrinberg joined18:28
ikke No, there is not18:28
In theory there can be more than one Nth commit18:29
History is not necessarily flat18:29
ghost43 left18:29
jnnnnnnnnn left18:29
ghost43 joined18:30
ikke there can also be more then one root commit, so a single commit can have multiple positions18:30
jnnnnnnnnn joined18:31
ecraven yea, it seems in this repo there are no multiple-parent-commits18:31
Codaraxis__ joined18:31
ikke right, but git cannot assume that, so git does not have general tools to give that information or to refer to commits in that manner18:32
jnnnnnnnnn left18:32
ecraven yea, I understand that. thanks for the tip, I'll just implement this as HEAD~(current-count - 19420)18:32
jnnnnnnnnn joined18:32
bertvvvs left18:34
perrierjouet left18:35
ikke https://tpaste.us/X0g118:35
Codaraxis_ left18:36
ikke https://tpaste.us/LeYm18:37
ecraven yea, I understand. thank you!18:37
roadie left18:38
roadie joined18:38
roadie left18:43
bertvvvs joined18:43
rgrinberg left18:45
rgrinberg joined18:47
tyson2 left18:49
justOkay left18:51
justOkay joined18:52
rgrinberg left18:53
The_Blode_ joined18:54
The_Blode left18:54
pyeveryt_ joined18:56
john_johnk joined18:58
dob1 I was reading this https://stackoverflow.com/a/28193740/399637 part 1. "This means the changes from f1 are not present on master (and cherry-picking possibly fails if f2 depends on them." if commits are snaptshot f2 has to include f1 too, it is just a diff then cherry pick ?18:59
ghost43 left19:00
duxsco joined19:00
ikke dob1: cherry-pick roughly diffs a commit against its parent, and then tries to apply that on the target19:00
ghost43 joined19:01
dob1 ikke, and when you specify more than one commit ?19:02
ikke It just iterates over each commit19:03
Jacques joined19:03
vicfred joined19:03
dob1 it creates a diff for each one ?19:03
ikke yes19:04
jimklimov left19:04
ghost43_ joined19:06
jazzy joined19:08
ghost43 left19:09
roadie joined19:09
structoha joined19:09
john_johnk left19:13
roadie left19:14
vitali64 joined19:15
wakeup joined19:15
roadie joined19:17
vitali64_ joined19:20
vitali64 left19:22
structoha left19:24
vitali64_vitali6419:24
rgrinberg joined19:25
roadie left19:27
junebug joined19:28
marstaik[m] joined19:28
duxsco left19:29
marstaik[m] Hi, I've got a question regarding how to do a clean merge from an upstream while maintaining locally deleted files in a sane way19:29
Say Ive checked out upstream, done changes to it, and completely deleted some extra module folders that I deem I dont need19:30
rgrinberg left19:30
marstaik[m] I then want to keep myself up to date with upstream, so I checkout upstream into another local branch19:30
nedbat marstaik[m]: i would recommend not deleting those folders. why not just keep them?19:30
marstaik[m] Extra things that aren't really needed19:30
ikke delete them when deploying?19:31
marstaik[m] I dont even have them registered in the build system19:31
In this particular case, Ive ported the upstream to a completely different buildsystem, so every time I merge it keeps trying to bring their build files back, there are large amounts of thirdparty libraries I don't care for either19:31
vitali64 left19:32
marstaik[m] I guess I could solve it with a custom post-merge script that just deletes everything again but I was hoping there would be a better way19:32
vitali64 joined19:32
duxsco joined19:33
ikke no19:33
marstaik[m] I see, guess I can just make bat file or python script that nukes them all after I merge, or during merge19:34
vaio ohai, which self-hosted "git platform" would your recommend ? ie: gogs, gitea, something else ?19:35
ikke depends on your needs19:35
gitea and gogs are quite similar (one forked from the other)19:35
vaio well, it's gonna be a public infra containing some project documentation, and we need to be able to "filter" who can access it19:36
nedbat marstaik[m]: why delete them at all?19:36
marstaik[m] theres just so much of them, and the clutter19:36
vaio (ie: clients will need to access it, and presumably provide PR; also, it needs to be user friendly, so non technical people would be able to edit stuff from within the browser)19:37
ikke gitlab supports that19:37
nedbat marstaik[m]: clutter on your disk? are you running out of space? don't complicate your life needlessly19:37
vaio neat, gonna take a look, thanks ikke19:37
marstaik[m] mmmm Id have to think about it19:39
There are other files I have deleted too that I actually do need to keep deleted as well19:40
nedbat marstaik[m]: ok, those files: why do they have to be deleted?19:40
marstaik[m]: is the upstream uninterested in your changes?19:40
marstaik[m] In this case, yese19:40
* In this case, yes19:40
etuckeriv joined19:47
EvilDMP left19:49
vitali64 left19:51
marstaik[m] maybe it is just better to keep them...19:52
zeenk joined19:52
vitali64 joined19:53
feriman left20:01
ghost43 joined20:03
ghost43_ left20:03
ghost43 left20:05
ecraven left20:05
ghost43 joined20:06
feriman joined20:06
Lord_of_Life_ joined20:09
Lord_of_Life left20:11
on^ left20:12
Lord_of_Life_Lord_of_Life20:12
vitali64 left20:13
vitali64 joined20:14
rgrinberg joined20:20
feriman left20:25
perrierjouet joined20:27
___nick___ joined20:28
___nick___ left20:28
anaveragehuman left20:29
___nick___ joined20:30
vitali64_ joined20:30
jimklimov joined20:30
feriman joined20:30
vitali64 left20:33
rgrinberg left20:34
wakeup left20:37
feriman left20:41
hololeap left20:42
chemsmith joined20:43
hololeap joined20:44
phox joined20:44
phox soooooo. is anyone going to object to a patch where a rebase on the destination branch retains merge parents for merge commits?20:45
ikke phox: maybe today is your lucky day20:45
phox every time I commit ; checkout mainline ; merge ; pull (yes I should remember to pull first) I encounter this IMO-wrong behaviour :P20:45
ikke look at git rebase --rebase-merges20:45
phox ikke: is someone writing it?20:45
k, checking20:45
ikke someone already did20:45
phox heh20:45
I wish it was default but something :)20:45
ikke: although this is for auto-rebase-on-pull20:46
so maybe it's not tied in where I need it20:46
would basically be an option to pull, or a config option better yet20:46
feriman joined20:47
vysn joined20:48
phox > Any resolved merge conflicts or manual amendments in these merge commits will have to be resolved/re-applied manually.20:48
I mean I guess I'd be in the same boat with the pull as-is, I'm just not hitting merge conflicts there...20:48
EvilDMP joined20:51
bertvvvs left20:52
vitali64_ left20:53
feriman left20:53
vitali64 joined20:53
irc_user joined20:54
AnapodoPsalidaki left20:57
feriman joined20:59
m0viefreak joined21:02
___nick___ left21:03
feriman left21:07
Thanatermesis joined21:08
madewokherd left21:10
vitali64_ joined21:12
feriman joined21:13
vitali64 left21:13
vitali64_ left21:14
tyson2 joined21:14
duxsco left21:14
Rashad left21:15
ghost43 left21:16
ghost43 joined21:16
ghost43 left21:17
ghost43 joined21:17
Techcable left21:18
Techcable joined21:18
feriman left21:21
junebug left21:28
Deknos left21:31
vysn left21:31
Codaraxis__ left21:33
ProperNoun joined21:35
madewokherd joined21:37
feriman joined21:46
Codaraxis__ joined21:49
Codaraxis__ left21:53
srinidhi left21:53
Codaraxis__ joined21:53
Sulky__ left21:59
Sulky__ joined22:01
Codaraxis__ left22:05
ghost43 left22:07
ghost43 joined22:08
peepsalot joined22:09
geowiesnot joined22:10
wakeup joined22:22
feriman left22:24
jimklimov left22:25
ghost43 left22:28
ghost43 joined22:28
Sulky__ left22:29
etuckeriv left22:37
eddie joined22:38
eddieetuckeriv22:39
etuckeriv left22:42
DoofusCanadensis left22:44
geowiesnot left22:47
qwedfg joined22:49
madewokherd left22:51
junebug joined22:52
moldorcoder7 left22:53
pulse left22:58
moldorcoder7 joined22:58
pizdets_ joined23:03
awmv joined23:03
pizdets left23:04
palasso left23:07
ghost43 left23:08
pulse joined23:09
ghost43 joined23:09
jimklimov joined23:15
Gustavo6046 left23:16
zeenk left23:20
xkuru left23:20
kenanmarasli left23:23
stats4647 joined23:27
junebug left23:28
vicfred left23:29
madewokherd joined23:33
wakeup left23:39
pretty_dumm_guy joined23:44
awmv left23:45

Logs Search ←Prev date Next date→ Channels Documentation