Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
welcome to hell
Jun 9, 2006

oiseaux morts 1994 posted:

But we can go back to a specific commit, and change date, author, commit message, right? Does that mean the original is deleted and a new commit is made? If so, then what if said original commit is a parent of another commit?
A new commit is created, but the original commit still exists in the repository. It's just no longer connected to the branch in any way. Eventually, if no branches or tags refer to the commit (or any child commits) it will get cleaned up.

quote:

So in the below case, if it isn't the timestamp that defines the order, what is the nature specific to one of the parents of C6 (either C4 or C5) that determines the order? Sure, 5 is greater than 4 in this example, but they're just labels in this case, they could easily be called * and / and have no inherent order. Or do the parent attributes for the commit object contain some hitherto unknown information, or is it a property of the graph structure in some way?
Where there is a parent/child relationship, git log will show the child before its parent. In that image, C4 vs C3+C5 don't have a parent/child relationship, so that can't be used for the order. In that case (parallel branches) timestamps will be used. Your earlier example with C1-C4 was an entirely linear history, so timestamps wouldn't be used to order the commits.

Adbot
ADBOT LOVES YOU

o.m. 94
Nov 23, 2009

welcome to hell posted:

A new commit is created, but the original commit still exists in the repository. It's just no longer connected to the branch in any way.

Understood, but say I have C1 <- C2 <- C3, and I modify the commit message for C2, I can't possibly have C1 <- C2' <- C3, because that would require C3 to be modified.

So I would imagine something like this

pre:
            *foo
C1 <- C2 <- C3

Change C2's commit message and all following commits would have to be replaced so the parents could be changed. The branch pointer would be moved to these new commits.

pre:
      C2 <- C3
|-----|
v            *foo
C1 <- C2' <- C3'
Seems mental, especially if you wanted to edit a commit way back, you'd create a massive chain of copies of your original commits. But I suppose if the old commits are garbage collected anyway, it's a viable method? Sorry, I appreciate this is really pedantic but stuff like this just sets off my goony autism like nothing else

o.m. 94 fucked around with this message at 12:46 on Nov 15, 2013

ToxicFrog
Apr 26, 2008


oiseaux morts 1994 posted:

Seems mental, especially if you wanted to edit a commit way back, you'd create a massive chain of copies of your original commits. But I suppose if the old commits are garbage collected anyway, it's a viable method? Sorry, I appreciate this is really pedantic but stuff like this just sets off my goony autism like nothing else

That is exactly how it works.

Bear in mind that commits themselves are tiny, and the file data they point to is in content addressed storage and thus deduplicated. So if the commit contents are mostly the same the space cost is minimal even before garbage collection.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

aerique posted:

You seem quite insistent to rationalize why you should not invest time in Git. While you can just keep on using SVN if you want to.

I'm not going to go into a discussion about Hg vs Git, but both offer more features and vast improvements over SVN.

While Git's underlying structure is actually pretty simple I do agree the commandline tools are more confusing than they should be, but even that is improved on with every release.

I use git every day, but I see a lot of blanket statements in here like 'git is just better' and like all blanket statements those are false. git has a different feature set, not a better feature set.

wwb
Aug 17, 2004

Gul Banana posted:

speaking of git! does anyone know about good git server/wrapper software that is *easy to host on Windows*?
imagine an environment where words like "linux" or "java" are met by an angry mob, or a pink slip. it doesn't have to do much; stuff like web access, pull request hosting, code reviews, that would all be *nice* but all I really want is something that works faster and more reliably than "put your repo.git directories on a share", which is all we've managed to date.

Alternatively HG works reasonably well on windows and is reasonably easy to setup -- see http://www.jeremyskinner.co.uk/mercurial-on-iis7/

Bonus points is that the windows clients are better too.

raminasi
Jan 25, 2005

a last drink with no ice

Plorkyeran posted:

The only documentation for it I could find is a handful of out-of-date blog posts and an expensive book, but all of the stuff for that screenshot can be found at https://github.com/Aegisub/Aegisub/tree/master/aegisub/build. The important bits are Aegisub.xml, which defines the fields which will be settable via the UI, Aegisub.targets, which imports that file and adds it to the project settings, and DefaultConfiguration.props, which sets the default values for all of the settings.

Cross-project settings aren't directly supported, but you can import the user settings file from one project in the other ones.

Getting this all working will probably require a nontrivial amount of time fiddling with include orders and cursing msbuild's miserable documentation.

Actually, getting this set up was pretty easy (finding that old blog post helped). It turns out that the properties you establish will just live in macros, so I didn't need to finagle with targets or build orders or anything. Thanks so much for your help.

NoDamage
Dec 2, 2000
What's the easiest way to view the differences between two git branches using a GUI?

Essentially, I want to be able to browse through the results of
code:
git diff master..branch
in some kind of tool that shows me all the files that changed, and then lets me click on each file and see the diffs between them.
code:
git difftool master..branch
doesn't really work since it opens up each file individually, instead of showing me all the diffs at once. Do I need to configure something?

ToxicFrog
Apr 26, 2008


NoDamage posted:

What's the easiest way to view the differences between two git branches using a GUI?

Essentially, I want to be able to browse through the results of
code:
git diff master..branch
in some kind of tool that shows me all the files that changed, and then lets me click on each file and see the diffs between them.
code:
git difftool master..branch
doesn't really work since it opens up each file individually, instead of showing me all the diffs at once. Do I need to configure something?

gitk can do this; open it up, select one branch, then right-click on the other and "diff this->selected" (or vice versa).

I think there's also a way to get it to pass all the filepairs to difftool at once (if your difftool supports that), but I don't remember where I read it.

Woodsy Owl
Oct 27, 2004
After a week of casual tinkering with Git, everything finally 'clicked' and oh my God Git is so sick!

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Woodsy Owl posted:

After a week of casual tinkering with Git, everything finally 'clicked' and oh my God Git is so sick!

I know, right?

It takes some getting used to and some understanding, but now I never want to go back to another CVSC.

Woodsy Owl
Oct 27, 2004

Volmarias posted:

I know, right?

It takes some getting used to and some understanding, but now I never want to go back to another CVSC.

I'm still trying to work out how to use it, but I get the idea behind it.

I use command-line git to do my commits and whatever and then I close it afterwards. When I open it back up, will git automagically checkout the master local repository? That is to say: I open the git command line,init a repository, add some files, commit, and then exit the command line interface. Then I edit some of the files. Then I fire up git in a command line again. Will git automatically checkout the last commit into the working directory, and therefore remove my changes to those files? Also, does git automatically track everything?

This is a correct statement; "git commit" only commits newly added files, "git commit -a" only commits tracked-and-changed files" ?

Is it just me or is the git documentation really obscure? The learning-curve seems pretty steep, but I know it will be worth it if I keep plugging away at it.

Marsol0
Jun 6, 2004
No avatar. I just saved you some load time. You're welcome.

Woodsy Owl posted:

I'm still trying to work out how to use it, but I get the idea behind it.

I use command-line git to do my commits and whatever and then I close it afterwards. When I open it back up, will git automagically checkout the master local repository? That is to say: I open the git command line,init a repository, add some files, commit, and then exit the command line interface. Then I edit some of the files. Then I fire up git in a command line again. Will git automatically checkout the last commit into the working directory, and therefore remove my changes to those files? Also, does git automatically track everything?

This is a correct statement; "git commit" only commits newly added files, "git commit -a" only commits tracked-and-changed files" ?

Is it just me or is the git documentation really obscure? The learning-curve seems pretty steep, but I know it will be worth it if I keep plugging away at it.

No, git won't override your working directory unless you tell it to. Any new files that you add to your working directory will be there when you come back to it in the command-line. Git just tracks the stuff in the repo and lets you know if your working directory differs in any way (git status).

git commit -a will do a commit that adds all changes, tracked or otherwise. If you want to only commit file that are being tracked and changed you would do git add -u to stage those changes, then git commit to commit what you've staged. This two step process is how I would suggest you work with git, at least at first.

Woodsy Owl
Oct 27, 2004

Marsol0 posted:

No, git won't override your working directory unless you tell it to. Any new files that you add to your working directory will be there when you come back to it in the command-line. Git just tracks the stuff in the repo and lets you know if your working directory differs in any way (git status).

git commit -a will do a commit that adds all changes, tracked or otherwise. If you want to only commit file that are being tracked and changed you would do git add -u to stage those changes, then git commit to commit what you've staged. This two step process is how I would suggest you work with git, at least at first.

So "git commit -a" is equivalent to "git add -u" + "git commit" ?

Marsol0
Jun 6, 2004
No avatar. I just saved you some load time. You're welcome.

Woodsy Owl posted:

So "git commit -a" is equivalent to "git add -u" + "git commit" ?

Almost. git commit -a will include untracked files as well, while git add -u; git commit will only include tracked file.

welcome to hell
Jun 9, 2006

Marsol0 posted:

Almost. git commit -a will include untracked files as well, while git add -u; git commit will only include tracked file.
This is incorrect. commit -a does not include untracked files.

Marsol0
Jun 6, 2004
No avatar. I just saved you some load time. You're welcome.

welcome to hell posted:

This is incorrect. commit -a does not include untracked files.

Hrm, I guess you're right. I was under the impression that it did. Thanks for correcting me. Sorry for any confusion.

Woodsy Owl
Oct 27, 2004
How can you list the files that are currently being tracked in a git repository? git status seems to only show files that haven't yet been added...

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
I think git ls-files is what you want.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Woodsy Owl posted:

How can you list the files that are currently being tracked in a git repository? git status seems to only show files that haven't yet been added...

Git status shows the difference between the most recent commit on your branch, what you've staged, and what changes are unstaged. Use git-ls as suggested, and filter on unmodified files.

o.m. 94
Nov 23, 2009

Woodsy Owl posted:

I use command-line git to do my commits and whatever and then I close it afterwards. When I open it back up, will git automagically checkout the master local repository? That is to say: I open the git command line,init a repository, add some files, commit, and then exit the command line interface. Then I edit some of the files. Then I fire up git in a command line again. Will git automatically checkout the last commit into the working directory, and therefore remove my changes to those files?

It's worth reading up on HEAD. Every repository has a HEAD, which points to a branch and thus follows it - when you make a commit in a branch, the branch pointer moves to the new commit, and thus HEAD references the new commit as well.

pre:
C1 <- C2 <- C4 (master <- HEAD)
       |
       -- C3 <- C5 (mybranch)
If I now type "git checkout mybranch", we are just moving where HEAD points to:

pre:
C1 <- C2 <- C4 (master)
       |
       -- C3 <- C5 (mybranch <- HEAD)
So your repository HEAD will stay where it is until you command it to move - by either switching branch, or going into a headless state (e.g. checking out a tag).

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
All the git command line window does is host a bash session, and that bash session doesn't do anything with repositories or working directories except run the commands that you give. Neither the window nor bash have anything to do with maintaining the state of git repositories. Individual git commands do that.

Gazpacho fucked around with this message at 23:54 on Nov 28, 2013

Woodsy Owl
Oct 27, 2004
Solid. You guys got me all squared away. I'm working my way through this documentation now. Everything's starting to come together in my mind.

Woodsy Owl
Oct 27, 2004
This isn't so much a git question as a GitHub question; I know you need a README.md to be able to clone a repository but how exactly do you format it? Is there a certain standard that should be followed? How is the README.md parsed on GitHub? How do you write a good README?

edit: I am working through https://github.com/github/markup/edit/master/README.md and figuring it out, more or less.

Woodsy Owl fucked around with this message at 11:13 on Nov 29, 2013

Dirty Frank
Jul 8, 2004

Woodsy Owl posted:

This isn't so much a git question as a GitHub question; I know you need a README.md to be able to clone a repository but how exactly do you format it? Is there a certain standard that should be followed? How is the README.md parsed on GitHub? How do you write a good README?

edit: I am working through https://github.com/github/markup/edit/master/README.md and figuring it out, more or less.

Its markdown, the syntax can be found here http://daringfireball.net/projects/markdown/syntax

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Woodsy Owl posted:

This isn't so much a git question as a GitHub question; I know you need a README.md to be able to clone a repository but how exactly do you format it? Is there a certain standard that should be followed? How is the README.md parsed on GitHub? How do you write a good README?

Wait, what? I clone my own repos all the time without a README.md...

evensevenone
May 12, 2001
Glass is a solid.
I think github either makes you add one or you have to have at least one file in the repo, so they suggest that.

Woodsy Owl
Oct 27, 2004

Thermopyle posted:

Wait, what? I clone my own repos all the time without a README.md...

I was taking this
pre:
Initialize this repository with a README This will allow you to git clone the repository immediately. 
at face-value. Tp, are your repositories hosted on GitHub? I haven't actually tried cloning a rep yet.

Also, GitHub is suggesting I call my new rep cloaked-octo-shame. Sounds kinky.

edit: bugfree-dubstep, petulant-wookie, north-american-hipster

Woodsy Owl fucked around with this message at 02:40 on Nov 30, 2013

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
iirc you can't have an empty directory in git so if you want to be able to clone a repo it can't be empty.

welcome to hell
Jun 9, 2006
Empty repos are a special case that git does handle, and will normally allow you to clone. They don't have any branches or commits though, so they don't always behave as you might expect. It's just more straightforward (and possibly more backward compatible) when you clone a repo with real branches/commits. Also, github displays readme files directly below the file listing on the main repo page, so they encourage you to have some form of readme no matter how you create the repo.

When creating new repos I prefer to initialize it and commit locally, then create the repo on github and add that as a remote. But it all amounts to the same thing in the end.

Woodsy Owl
Oct 27, 2004
With regards to git, how common are other VCS solutions these days? Is it worthwhile to master SVN or whatever else?

aerique
Jul 16, 2008

Woodsy Owl posted:

With regards to git, how common are other VCS solutions these days? Is it worthwhile to master SVN or whatever else?

Git is becoming more and more prevalent. Older, slower moving companies will still be using CVS or SVN so it would be good to have some experience with them but I would not "master" them. Especially since they do not really offer anything over Git.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Woodsy Owl posted:

With regards to git, how common are other VCS solutions these days? Is it worthwhile to master SVN or whatever else?

It's worthwhile if your job uses SVN and does not plan on switching any time soon. It's kind of a tough thing to answer because it's like asking "with regards to Python, how common are other programming languages these days? Is it worthwhile to master Perl or whatever else?"

Woodsy Owl
Oct 27, 2004

Volmarias posted:

It's worthwhile if your job uses SVN and does not plan on switching any time soon. It's kind of a tough thing to answer because it's like asking "with regards to Python, how common are other programming languages these days? Is it worthwhile to master Perl or whatever else?"

Wow, I didn't consider that. It's kind of a stupid question, in hindsight.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Woodsy Owl posted:

Wow, I didn't consider that. It's kind of a stupid question, in hindsight.

It's not a stupid question, it's just a little asinine. You should definitely understand the difference between CVCS and DVCS, since it will let you talk more intelligently about your choice to use a DVCS, and if you need to use SVN etc you won't be completely blindsided. That said, I personally wouldn't recommend more than a working familiarity unless you'll be using it frequently.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
While there are many factors to consider in any given workplace, a company that still uses CVS as its main version control is broadcasting that they don't have any kind of technology leadership in place, and that they see fit for devs to manually wrestle with problems (like version skew) that have had affordable automated solutions for over a decade.

e: meaning the Concurrent Versioning System

Gazpacho fucked around with this message at 05:41 on Dec 1, 2013

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
For the specific case of git and svn, git-svn is good enough that you can mostly get away without knowing how to use svn.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Gazpacho posted:

While there are many factors to consider in any given workplace, a company that still uses CVS as its main version control is broadcasting that they don't have any kind of technology leadership in place, and that they see fit for devs to manually wrestle with problems (like version skew) that have had affordable automated solutions for over a decade

If you mean CVS as in centralized versioning, I think that companies can have compelling reasons to want to use a CVCS, such as stronger controls (it's more difficult to accidentally leak a full SVN repo than a git clone) without being shortsighted.

If you mean CVS as in CVS, then yes, that's a good sign that you should run, not walk, out of the interview.

fartmanteau
Mar 15, 2007

Using git, if I have a tracking branch to remote A, can I push that to remote B such that cloning from B will retain references to A?

I'm using git-svn to migrate a messy work repo to git, and it tracks svn branches as remote branches. Now I'm pushing to a new git repo, but I'd like a way to track and merge the svn changes that are bound to come in during the interim. Ideally I'd like to do this without having to maintain the original git-svn working copy.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
I have a decent working knowledge of Git and Mercurial, but rarely use anything that would clean up branches & histories as the projects are typically only with 1 or 2 people. I'm sure theres a lot of this that would be personal style, but is there something like a best practices guide to managing branches and history for maintainable projects.

The ability to rewrite history and clean it up is obviously very powerful after the dirtier working state has been cleaned up, but I haven't really ever seen much more than a users manual for version control, so I'd like to know if there's good resources to pick up this stuff.

Maluco Marinero fucked around with this message at 08:23 on Dec 2, 2013

Adbot
ADBOT LOVES YOU

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

fartmanteau posted:

Using git, if I have a tracking branch to remote A, can I push that to remote B such that cloning from B will retain references to A?

I'm using git-svn to migrate a messy work repo to git, and it tracks svn branches as remote branches. Now I'm pushing to a new git repo, but I'd like a way to track and merge the svn changes that are bound to come in during the interim. Ideally I'd like to do this without having to maintain the original git-svn working copy.

I think that it's possible to recreate the state of your original import, but realistically I'd say that it's easier to say better safe than sorry, and just keep it around until you're reasonably confident that everyone has migrated.

Maluco Marinero posted:

I have a decent working knowledge of Git and Mercurial, but rarely use anything that would clean up branches & histories as the projects are typically only with 1 or 2 people. I'm sure theres a lot of this that would be personal style, but is there something like a best practices guide to managing branches and history for maintainable projects.

The ability to rewrite history and clean it up is obviously very powerful after the dirtier working state has been cleaned up, but I haven't really ever seen much more than a users manual for version control, so I'd like to know if there's good resources to pick up this stuff.

You might want to take a look at http://sethrobertson.github.com/GitBestPractices/#sausage . I'm personally a proponent of hiding the sausage making, and I consider the ability to rewrite your own history (and rebase -i in general) to be a killer feature of git, but I'm a bit of a perfectionist and it has bitten me in the past on occasion.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply