« first day (4312 days earlier)      last day (861 days later) » 

01:26
Sorry for a bit of off-topic, can someone settle, what is going of with git:
I have two branches, want to copy paste bunch of commits from middle of one to top of another. Let's say I want to copy-paste commits ...-B-C-D-E-... from branch B1 to B2
It's incredibly simple and intuitive in terms of folders: checkout B, copy all files in folder, throw it on top of B2, checkout C, copy all file in folders, throw them on new top of B2, etc
Question: I really cannot understand what is reason behind every git SO answer to do this is pure mess and creates merges conflicts. Why on earth this cannot b
and by throw I mean complete clean override, i.e. first delete all previous files, then paste them from next checkout of B1
01:46
@halt9k you might be looking for git rebase
Common + B2p - B2q - B2r - B2s  (B2)
       \
          B  -  C  -  D  -  E   (B1)
to
Common - B2p - B2q - B2r - B2s -  B  -  C  -  D  -  E   (B1)
the command to do so should be
git checkout B1
git rebase -i B2
it's less about creating merge conflicts at this stage but more that you will need to be sure this won't create merge conflicts in the future - what if you end up with another branch with basically the same commits as the B, C, D, E commits, as they really may not be the same
this is fine for making sure the feature branch is matched with the main branch, less fine if you want this to be a backport friendly security fix branch
and by not really the same commit, rebasing effectively create new commits as they won't have the same changeset identifiers due to the graph being changed
Just that bugs me- I can do exactly this manually and it guarantees no merge conflicts
and also rebasing will ensure any merge conflicts are actually picked up per commit
well, you do this manually and you might end up accidentally remove code you do not want
and if you got a conflict you can always use the pick my branch only merge strat
no, it's basically attempt to insert lost versions into already existing chain - i.e. I have v5-v6-v8-v9 and found version v7, i.e. guaranteed no lost code
like you can git rebase -s ours B2
well, without the exact code base I am not even sure if we are actually talking about the same thing, so if you think your idea works, then use your idea
just that you are doing things out of band and that can potentially introduce loss, unless what you are doing is effectively creating brand new commits from v0 v1 v2 folders
alright, will read into answer, thanks a lot really

one last - is there way to expand commit so it was self-contained?
01:58
@halt9k I would git checkout -b v6 <v6_sha>, copy v7 in place, git add everything, and then git checkout -b v9 <v9_sha> and git rebase -s ours v6
define what you mean by "self-contained" commit
also reading deeper into the -s ours I am not quite sure if that's what you actually want
great thanks, will read every your answer now more carefully - this so terribly bugs that you when file solution is obvious, but git somehow makes this complicated! Wanted to get live answers badly! Thanks!
but I am sure there is a merge strategy used in rebase that only cares about our branch and all conflicts are discarded
git is not complicated once you realize it's a clunky UI for manipulating a DAG
https://stackoverflow.com/questions/32460551

Do we actually have a general canonical for "Q. Why does this string literal with a backslash in it not work? A. You need to double up the backslash because it's an escape character etc. etc."? https://stackoverflow.com/questions/19095796/how-to-print-a-single-backslash has a lot of weight already but it *isn't general enough*
ultimately, it sounds like you are trying to create a git commits from scratch from a bunch of files, I'd have nothing much to advise here
it's also somehow you want this to be possible to make commits snapshots and do some operations on that level (especially if no history rewrite involved)
02:03
@halt9k you can always check out any commit to a new named branch and do anything you want, this would create a new commit at the branch
you can do so much in git, but without knowing very exactly what you want to do it's hard to give specific recommendation
thanks for now, first need to pull previous answers into head :)
@KarlKnechtel yeah it's not bad, though there are variants involving the various escape sequence, bytes, and people confused about why does me print a variable it shows up \xac (or whatever) but actually want that interpreted, or they printed a bytes and the repr form shows up
good lord I've answered a lot of unicode, ascii, and various escape codec related questions
probably some ideas in there idk
stackoverflow.com/questions/16689448/… also need a better canonical for all the questions like this one
I think "why does the output show a(n extra) backslash?" is a different question from "why does my string literal not work?". The repr-of-bytes has the same underlying cause as the escaped backslash (or normalized single-quote string, etc etc) so I think that's the same question
Something like "Why don't my strings and bytes objects look like how I typed them in?"
maybe
that question is a good example of the phenomenon, yes
02:23
yeah but imo Python bytes type just don't do the correct thing to tell the user the difference between str and bytes
stackoverflow.com/questions/56351641 also sort of relevant. surprisingly good answer here for a low attention question
@metatoaster 100% agreed; the legacy of interpreting bytes as text persists.
the bytes type also has a bunch of truly nonsensical textual methods
02:55
that is indeed what would like to get;
went over answers, seems already tried them before going into this chat; with same problem - merge occurs where all previous files supposed to be just deleted and checkout result of commit B is placed instead

if to try explain what I mean by snapshot in steps:
- to freeze checkout state of all commits (B2p - B2q - B2r - B2s and B - C - D - E);
i.e. after desired operation I'd like checkout(B) to be exactly same as before
and checkout(E) same as when there were two branches
03:06
this indeed will probably change each commit B - C - D - E to some new B* - C* - D* - E*, but this supposed to happen during some sort of temporary exclusive ownership, after which B - C - D - E will be even deleted from repository
 
1 hour later…
04:15
Finally after few more hours of frustration, seems found exact answer for my case:
https://stackoverflow.com/questions/6963539/git-how-to-re-order-severely-a-commit-sequence
That's hard to believe though that such simple and intuitive file operations became practically pain when translated to git
 
1 hour later…
05:22
@Flo Let's chat here
@Flo what time GMT do you want to chat?
I don't think you can ping someone who hasn't talked here recently
06:01
I am creating a simple tkinter gui and I want to save the gui contents as a pdf or png/jpg. Can someone direct me where I can find related help?
Flo
Flo
06:21
@pygeek Man, I've never used SO chat. This is so confusing. I will try to keep the chat open. So just respond as soon as you can
06:41
@Huzaifa I don't think there's a way to do that, outside of taking a screenshot and cropping out the part where your window is
I want to make a exe file of this gui so I thought that would be cool if i add a button which will save the gui interface as a pdf or pic.
i know last option is take ss and then crop, but i am looking for some Pythonic solution
07:02
Update: I used Pyautogui and am able to take screenshot, and save it. Thanks
@Flo and @pygeek we don't know any context to this. If you're preparing to have a detailed discussion that doesn't involve the rest of us, you're able to start a "private" chat - that is, if you click on the icon of the person here, you can select to "start a new room with this user"
07:45
Is it possible to move my question above with pair of relevant answers to other chat? Honestly that was (and still is, SO answer not yet working) so frustrating question that couldn't wait until Git chat will be visited (and seems it's quite a desert)
FWIW I don't mind that discussion living in this chat. If you feel passionately that it should be moved to another chat on SO then I can look into that (I'd have to check the other room and be sure I'm not just dumping stuff unsolicited) but if it's going to move there to die then it seems metatoaster's efforts, which might be more-generally useful, get binned with it
We "regularly" have git discussions, which permeate all languages
alright then, it was just in case of noticeable violation
seems at least that manual checkouts should work, but almost hilarious that even it does not produce same snapshots for some reason... It checkouts to snapshot which it not equal to any commit in repo. But prob some switch will finally fix this soon
Hi guys! Is there a community wiki for python syntax?
08:05
Not as far as I know, and I think that's a good thing. People tend to (ab)use those to close duplicates. I've seen it in the regex tag, and that one also has more than 700 duplicates linked to it
09:17
@Aran-Fey I see thanks
 
2 hours later…
10:55
@halt9k as I said before, git rebase is definitely able to do that, and you can just copy over any conflicts and force add everything using the "exact" copy of B if that's what you want - I use git rebase to stack branches, though I am not sure what exactly you are referring to about "temporary exclusive ownership". Also as I noted earlier, git's UI is absolutely clunky so I won't blame you if you can't use the UI to do exactly what you want
@halt9k That's... basically bad advice, during the git rebase -i operation, you can just stop at every commit and git reset --hard <commit_id_you_want_this_commit_to_be> and then git rebase --continue. The git UI is clunky if you want to go full micromanage the finer details of the commit but generally under normal coding development I never find that necessary
Though really, as I said, git UI is bad, so what I gave is also bad advice for those who do not understand the underlying git data model
 
2 hours later…
13:05
@metatoaster sublimemerge.com isn't too bad a bit of software if you want to avoid the command line... and probably also using sublime text at the same time for things...
13:22
Sometimes abandoned libraries are neat... you can use undocumented features without much worry
13:35
said the black hat hacker
13:56
You could always create a fork of an actively maintained library and abandon it
That's genius!
 
3 hours later…
17:18
Juhu, I unlocked the chat.
Is here maybe somebody present who know tkinter and like to answer questions about it please?
@PythonSmurf welcome. Before you ask further please see our rules, especially the part about asking here about fresh questions on the main site.
Add a python tag to your question
17:37
@AndrasDeak--СлаваУкраїні Okay. I won't ask about my recent post. Currently searching the net, but unsuccessful.
17:54
I am the resident tkinter wrangler. I'll look at the question once I return from my errands.
I'd like to see the version of the code that uses grid, if you still have it
 
2 hours later…
19:34
Ok, I'm back.
Hmm, yep. I can't answer this until I see the grid code.
... and you're back in the room <clicks fingers>
Hmm, I feel slightly as if I had believed I was a chicken for the last two hours
That's completely normal. Those memories will fade over the next 3 days
Capital.
Absolutely nothing to worry about. Certainly not on my side, you signed the papers seemed quite happy when you left my fine establishment
19:42
To answer the abstract part of the question, you're allowed to mix and match grid/pack, as long as they're not siblings on the widget tree. For example, f = Frame(root); f.pack(); x = Button(f); x.grid(row=1, column=1) is valid.
@roganjosh You have richly earned the five star Yelp review I am about to write. Oh, it seems that I already wrote it. I must have forgotten.
Have you transitioned from quatloos? Reviews are a very different beast/currency
You will give me 5000 quatloos, and a 5* rating
Hmm, I'm terribly busy, so I can't log in to QuatlooBase to transfer the payment. Could you do it for me? My wallet's private key is hunter2.
Sure. With gusto!
(I feel I've missed a reference)
I did... Apologies for not executing on your setup
(I'm pretending that quatloos are akin to bitcoin, and QuatlooBase is an exchange platform for quatloos, much like CoinBase is for Bitcoin. I have foolishly given you complete power over my funds by giving you my private key. Either because of the latent effects of hypnosis, or because I'm just like that all the time.)
Executing on my setups is optional and you may eject from a skit at any time by pulling on the red lever to your left
Pull the blue lever to drop me into the snake pit. Caution: this only makes me grow stronger.
20:12
@JonClements yeah, though I personally am very comfortable with the git cli UI, I can't say that for most people
the problem earlier was something similar to a problem I saw a colleague at my office struggle with (not so much inserting commits(? like halt9k ?), but needing to reconcile commits which was again best suited with git rebase
there hasn't been a thing that's supported by git that I can't do with git, though I really wish git did decouple identity from commits so it would stop deadnaming
mailmaps help with that, a bit
obviously not a perfect solution
yeah, but still it needs to be used from day one otherwise the person will effectively lost commits
or attribution to commits they have made previously
How so? What is the use case you have in mind?
from "deadnaming" I assumed you mean a user changing name/email/etc. credentials mid-project
20:31
yeah, effectively if git had a pseudo-anonymous identifier which the real identity is attached to via a reference, that can fix it
if they wish to keep the name it's another pointer to that node, this is all possible with a DAG
OK, but then I don't see the "needs to be used from day one" part.
if git had this then it wouldn't need to be; third-party solutions that isn't part of git need to be added in from day-one, otherwise if a commit is made using existing identity set up, it is not possible to change barring rewriting the entire graph
Mailmaps work retroactively though. So I guess it depends on the tool you want this to be exposed to.
yes, but mailmaps must be used from day one, the first commit
20:34
if user wrote their info to git commit it's there
Or perhaps I should ask: what part needs it to be there from day 1?
not requiring a name/email field
for the commit object
User starts contributing with name <[email protected]>, eventually switches to alias <[email protected]>. You can still map that.
@metatoaster are you talking about completely blank commits then?
yes but it is permanently in the history
that email/name be replaced with an identifier, and identities are then attached to it
@metatoaster Yes, that's why I said it's obviously not a perfect solution.
20:36
then it can be removed without killing the history
@metatoaster yes, I get what you want to have instead. What I'm trying to ask is what shortcomings mailmaps have.
which is why I said it must be used from day one, and/or everyone on the team must agree not to look at the old info
fair
anyway I gotta run
I assume your issue is not "people look at the log and see the wrong name". Your issue is "people can look at the past and figure out stale credentials".
@metatoaster talk to you later
yep
@AndrasDeak--СлаваУкраїні correct, that's deadnaming
anyway now I am gone
*poof*
@metatoaster now that you're gone I can ping with a last reply, you can respond if/whenever you feel like it :P so I only know "deadnaming" from its gender transitio meaning. In this regard the modern world is similar: you can't really get rid of old content with dead names if people go looking for it, it's much more maintainable to have a culture where people ignore all that and focus on what's current.
In other words, it would indeed be nice to have decoupled identities (although, shouldn't those identities also be version controlled...?). But in lieu of that, you can still push for community norms where digging into past history to do weird things is really icky. This won't remove the security aspect, for instance. The information is there if people look for it. But I would think (hope) that it's common for this not to matter at all.
Well-meaning contributors just look at git logs and stuff, and those should be shadowed by the mailmap. And ill-meaning contributors should quickly be escorted to the door.
 
1 hour later…
22:04
Hi Kevin, sorry. I did not see it. Nice to meet you. So one problem was that I forget to use pack on the parent for ttk.Entries and then nothing was visible
Could I ask something else, please?
I found this example https://stackoverflow.com/questions/33646605/how-to-access-variables-from-different-classes-in-tkinter
I think I have a similar problem and I don't understand the basic concept apparently.
What is in the example the controller, please? The class SampleApp()?
I am trying to realise a MVC design pattern for the first time. My View is a tkinter GUI. It is composed of 3 different classes for the frames (one window only). My top class is called View(). All my methods to access the widgets are in the View class. But for example, now I am in
@Kevin , sorry. I did not see it. Nice to meet you. So one problem was that I forget to use pack on the parent for ttk.Entries and then nothing was visible.
23:10
I just closed a few things as duplicates of stackoverflow.com/questions/59460305. Is there anything better?
Deleting them all as a non-issue? :P
you might want to give the same treatment to stackoverflow.com/questions/48144220/…
all the relevant posts I can find are ones that you've recently hammered
and stackoverflow.com/questions/44402740/… should probably have the same dupe target instead
23:43
I figured it out and I can communicate between my classes. If Bryan Oklaey reads here , thank you so much! Your examples on tkinter are pretty good!!!!

« first day (4312 days earlier)      last day (861 days later) »