Menu

installing git broke tkdiff for me

2022-02-21
2022-02-24
  • Elwood Downey

    Elwood Downey - 2022-02-21

    Just a word to the wise. I mostly still use RCS for small projects and am grateful tkdiff still supports it. But I recently started a project that uses git. As soon as I started using git, tkdiff stopped finding my RCS files.

    Bottom line: I discovered git created ~/.git which tkdiff always found and thus assumed I wanted to use git for everything, even if there was an RCS dir in my CWD. Removing ~/.git allows tkdiff to work normally again. Of course I need that ~/.git when using git but at least I have a way to work around this. I don't have any suggestions but it would be nice to have a way to tell tkdiff what I want it to.

    Long live tkdiff!

     
  • michael-m

    michael-m - 2022-02-21

    Please don't go scaring the peoples that haven't read the online help...

    So YES - TkDiff indeed will choose GIT over RCS - but only by default.
    You need to go investigate the User Preference setting called:
    Prefer given SCM when detected
    and decide which way you want Tkdiff to behave for you in a default situation.
    I think you will find that we will allow RCS and Git to peacefully coexist and Prefer whichever SCM you want at the moment. Note that in addition to it being a user Preference, you ALSO can specifically override it when initiating the Diff from the "FILE->New..." interactive panel as well.

    But I agree, long live TkDiff!

     
    • Elwood Downey

      Elwood Downey - 2022-02-21

      Thanks for the help.

      My apologies for the scare. I added "for me" in hopes it would temper the effect a little.

      Was not aware of these settings, sounds perfect.

      All the best...

       
  • michael-m

    michael-m - 2022-02-23

    Quick afterthoughts - If looking for other ways to switch among different SCM influences
    one way would be to make sure TkDiff cant FIND both simultaneously.
    For instance don't work on a Git repository out of your HOME directory , which suggests your entire directory tree could belong to Git. Do your git work in a SUB-directory and ChangeDir there instead. Another approach might be to have different User-Preference files, each set to a different SCM choice, and then decide which to use by using the TKDIFFRC environment variable to point at the non-default one when needed. All depends on what feels best to you.

    Good Luck, and thanks for using TkDiff!

     
    • Elwood Downey

      Elwood Downey - 2022-02-23

      Thanks for the extra tips, all good. I just realized I do have a $HOME/.git file but I'll be darned where it came from. I'm gradually trying to learn to use git on a project but it's not rooted off $HOME. Git still feels like a cave full of dark and twisty passages -- I expect to find a Wumpus lurking at every turn. Cheers!

       
  • michael-m

    michael-m - 2022-02-24

    LOL. Does anybody these days even REMEMBER what "Wumpus" was ?

    Anyway, I cant say for sure, but my guess is somewhere in your early exploration you were sitting in your HOME directory when you caused Git to initialize. I'm pretty sure Git simply uses wherever the CWD is to say "here is where the REPO will live", and it plants a hidden directory there. Afterward you may have switched to a more legitimate sub-directory and did it again.
    From a Git perspective, you would now have TWO REPOs . And while the second one probably works just fine, its because when it searches UP the directory tree it STOPS at the first place the hidden directory is found (in that sub-directory). After all, there has to be a way for you to have more than ONE repository within your user space! For that matter, the one in HOME may ALSO work fine because Git says that not EVERY file below the REPO root has to absolutely be considered PART of the REPO.

    TkDiff does a similar search when it runs, and would find EITHER depending (again) on where you WERE when you startup. Its just in this case, no matter WHAT directory you start from they ALL lead to your HOME dir, unless it finds one earlier as it moves UP the CWD chain. And THAT is why TkDiff ALWAYS picked Git for you. Actually I had already modified the User documentation (for an upcoming release) to EXPOSE the hidden precedence of which SCM wins when more than one can be found. I didn't invent the order; I inherited it. And as such it cant be modified without knocking existing users out of the water. Sorry about that. But that's why I did invent the SCM "preference" protocol to give people a way out.

    So if you don't KNOW what is supposedly in that HOME repository, maybe its actually "nothing" because you later started over in a sub-directory. Part of the key to making sense of Git is to remember it sprang from the mind of the guy who invented Linux. And while "Linux is not Unix" (to borrow the GNU pun) a lot of the principles are the same (everything is just a file, collection of little tools that each do one thing; building new tools out of stringing existing ones together, etc). Its not TERRIBLY difficult, but it can look daunting if you try to understand it in one big LUMP. Just learn the simple things first.
    Something else to remember is Git was built out of frustration, with situations not handled, or other annoyances of the PRIOR tools used at the time (BitKeeper? IIRC) - including pricing! So a bunch of exotic stuff sprang into existence VERY quickly, some of which you may NEVER need. Its a large buffet - eat slowly.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.