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
BizarroAzrael
Apr 6, 2006

"That must weigh heavily on your soul. Let me purge it for you."
I have a few people that are finding SVN "skips" on updating a certain folder in their working copy. You can update the contents fine, but an attempt to update on the directory just gets a "skipped" message. I've taken a look and the .svn directory is still there. Does anyone know what's going on?

Adbot
ADBOT LOVES YOU

ColdPie
Jun 9, 2006

epswing posted:

Why is that?

It'd work for a small group of people that you trust and who are familiar with Hg. But they could push conflicting branch names, or overwrite your branches, or whatnot. Basically, you're giving your entire team write permission into your repo. This is generally a bad idea, though of course it could work for your specific scenario.

epswing
Nov 4, 2003

Soiled Meat
I should have clarified that I'd have a clone specifically for accepting changes. In fact I could have as many clones as I have pushing developers, each hg serveing on a different port.

However...I see what you're saying. It makes sense that I would clone from them so I can load their changes into my development environment, and then if I liked what I saw, I'd actually pull into my working repo.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

epswing posted:

I should have clarified that I'd have a clone specifically for accepting changes. In fact I could have as many clones as I have pushing developers, each hg serveing on a different port.

So you'd be creating a "public" repository for each of them to push to? You've independently created the "integration manager" workflow described at http://whygitisbetterthanx.com/#any-workflow (ignore for the moment that this page is Git evangelism; the DVCS workflows described are mostly tool-agnostic).

Having a clone for each developer to push to (that you create and manage) is a strange idea; it makes more sense for each developer to manage that clone themselves. Each of them can publish their code into their public repository, and you pull from those at your leisure. If you like what you see, push it to the central repository (which the developers should regularly pull from).

It's a good idea for developers to have separate public/private repositories: one that is used for actual work and one that's used to publish changes to others when a feature/branch/etc. is stable enough to integrate. If you're pulling directly from their workspace without warning, you're likely to obtain half-done features/changes/etc.

Hughlander
May 11, 2005

In git is there any way of folding a series of commits into a single commit? I'm thinking of ways to embrace the 'it's cheap to branch' concept and was pondering linking save in my editor to an auto add/commit into a branch. Then I'd want to fold all of these micro commmits into a single large commit once a day or when regression tests pass. Then merge *THAT* commit and only that commit into the main branch so the main branch history only has the large commit and not hundreds of smaller ones all with an 'autocommit' comment.

Vanadium
Jan 8, 2005

git rebase --interactive commit-before-your-branch and read the instructions that show

This is destructive since it rewrites history so I guess you may want to duplicate your branch before trying.

Vanadium fucked around with this message at 17:29 on Jun 29, 2010

epswing
Nov 4, 2003

Soiled Meat

Lysidas posted:

:words:

So one public repository per developer (read/write) and one public central repository (read-only). By public I mean 'available on the internet'. That makes sense. So I can take a look at their changes, and be able to push from their public repo to the central repo.

code:
            +-- Available Online --+
            |                      |
        +---|---> Central Repo ----|--------------+
        |   |                      |              |
hg push |   |      Dev 1 Repo <----|--- Dev 1     | hg pull
        +---|----- Dev 2 Repo <----|--- Dev 2 <---+
            |      Dev 3 Repo <----|--- Dev 3
            |                      |
            +----------------------+
I like this.

Edit: Riiight, like this

epswing fucked around with this message at 18:34 on Jun 29, 2010

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Vanadium posted:

This is destructive since it rewrites history so I guess you may want to duplicate your branch before trying.
The old version will still be in the reflog so it's really not all that destructive.

Vanadium
Jan 8, 2005

Ah, I have not used the reflog apart from digging through it manually. I did not realise it counted as anything but an implementation detail. :shobon:

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Vanadium posted:

Ah, I have not used the reflog apart from digging through it manually. I did not realise it counted as anything but an implementation detail. :shobon:

One of the weird things about git that I have learned is that all the internal workings that you might think are "implementation details" are incredibly useful in specific scenarios.

Vanadium
Jan 8, 2005

I only ran into the reflog because git would not gc some multi-gb objects that were checked in at one point but since dropped through history rewriting, welp.

Modern Pragmatist
Aug 20, 2008
I have a directory that contains directories for three classes (A, B, and C). C is a subclass of both A and B.

Basically I want to setup svn to be able to allow for different versioning of each of these classes while at the same time having the other developers only have to update the parent directory (as if the entire folder were just a single repository).

Maybe there I'm way off and there is a better way to go about this. I am open to suggestions.

There is also the possibility that this post is terribly incoherent, if so I can attempt to explain it a little better.

ColdPie
Jun 9, 2006

Modern Pragmatist posted:

I have a directory that contains directories for three classes (A, B, and C). C is a subclass of both A and B.

Basically I want to setup svn to be able to allow for different versioning of each of these classes while at the same time having the other developers only have to update the parent directory (as if the entire folder were just a single repository).

Maybe there I'm way off and there is a better way to go about this. I am open to suggestions.

There is also the possibility that this post is terribly incoherent, if so I can attempt to explain it a little better.

No idea about SVN, though you can do this with git submodules really easily. But it sounds to me like you're trying to solve a problem the wrong way; trying to hammer a VCS into something it doesn't want to be. You might want to step back and rethink how things are laid out.

Describing your problem at a higher level (describe what you want, not how you want to get there) might help people in this thread give better suggestions.

musclecoder
Oct 23, 2006

I'm all about meeting girls. I'm all about meeting guys.
I'm having a bit of difficulty getting a Git post-receive hook working.

I'm working on a website, and what I want to happen is when I push the changes to the webserver, a post-receive hook will be executed, go to the directory where the website is, and pull in the latest changes. It's my understanding that this is how it should work rather than just pushing directly to the cloned repo in the web directory.

So, in my home directory on the server, I have a bare repo that I've pushed to. It works fine, I can push to it just fine. I made the post-receive hook there as well to cd to the web directory and do a git pull /home/vmc/website.git/ master.

If I'm on the actual server itself, I can execute the hook just fine and it works. However, if I set up the webserver as a remote push destination and push to it, I always get this error:

code:
fatal: Not a git repository: '.'
Any clue on what's happening? I've updated the post-receive hook to cd to the right directory and echo out the pwd in a text file and everything is correct. Doing a git remote -v on my local repo shows:

code:
target	ssh://website.com/~vmc/website.git (fetch)
target	ssh://website.com/~vmc/website.git (push)
website.git is a directory in my home directory that has the bare git repo and the post-receive hook.

Any help would be greatly appreciated.

EDIT: Fixed this. Git has an environment variable, GIT_DIR that it sets to '.' when you push to it remotely. Unsetting the environment variable (unset GIT_DIR) fixed this. Now the script would look like:

pre:
#!/bin/bash

cd /var/www/vhosts/website.com/
unset GIT_DIR
git pull

musclecoder fucked around with this message at 12:52 on Jul 17, 2010

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I wonder if I understand how branches are supposed to work in git. I have a repository cloned that I've been pushing up for awhile now, but I have some speculative changes I'd like to do in a branch. I first create the branch with 'git checkout -b waaah' and then branch to it with 'git branch waaah.' I have found that if I edit a file there and then switch back to the master branch, the changes persist. Shouldn't it not persist into the master branch unless I merge it?

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
Your post didn't explicitly say this, and I want to rule it out before any more investigation: did you commit the change(s) before switching back to master? Checking out a new branch should preserve local un-committed modifications (and untracked files) that don't conflict with the branch you're switching to.

sklnd
Nov 26, 2007

NOT A TRACTOR

Rocko Bonaparte posted:

I wonder if I understand how branches are supposed to work in git. I have a repository cloned that I've been pushing up for awhile now, but I have some speculative changes I'd like to do in a branch. I first create the branch with 'git checkout -b waaah' and then branch to it with 'git branch waaah.' I have found that if I edit a file there and then switch back to the master branch, the changes persist. Shouldn't it not persist into the master branch unless I merge it?
Well first off checkout -b will create the branch and check it out, so I don't know what you're up to with the 'branch to it' part.

Secondly, try committing changes to a branch before you expect the changes to be tracked by git.

ColdPie
Jun 9, 2006

Rocko Bonaparte posted:

I wonder if I understand how branches are supposed to work in git. I have a repository cloned that I've been pushing up for awhile now, but I have some speculative changes I'd like to do in a branch. I first create the branch with 'git checkout -b waaah' and then branch to it with 'git branch waaah.' I have found that if I edit a file there and then switch back to the master branch, the changes persist. Shouldn't it not persist into the master branch unless I merge it?

Yeah, you're pretty confused. I suggest reading up on the tool you're trying to use.

There's a really good resource that I just discovered right here:
http://progit.org/book/

HFX
Nov 29, 2004
How does one merge only one file over to another branch in git. I fixed a bug in one branch I was working on and need to merge the changes into another branch (the files are approximately 25% different before the change). Should I just copy both copies to somewhere else, merge there and then copy back into my tree on the branch I need?

Mithaldu
Sep 25, 2007

Let's cuddle. :3:

HFX posted:

How does one merge only one file over to another branch in git. I fixed a bug in one branch I was working on and need to merge the changes into another branch (the files are approximately 25% different before the change). Should I just copy both copies to somewhere else, merge there and then copy back into my tree on the branch I need?

If it's only one commit, this might be useful: http://ftp.sunet.se/pub/Linux/kernel.org/software/scm/git/docs/git-cherry-pick.html

HFX
Nov 29, 2004

Mithaldu posted:

If it's only one commit, this might be useful: http://ftp.sunet.se/pub/Linux/kernel.org/software/scm/git/docs/git-cherry-pick.html

It is spread over several commits that may have other files with them. I should have specified that. It makes cherry picking not work.

ColdPie
Jun 9, 2006

HFX posted:

How does one merge only one file over to another branch in git. I fixed a bug in one branch I was working on and need to merge the changes into another branch (the files are approximately 25% different before the change). Should I just copy both copies to somewhere else, merge there and then copy back into my tree on the branch I need?

You don't merge files, you merge branches. You might want to do a cherry-pick operation here. With your target branch checked out, just do: 'git cherry-pick <commit that fixes bug>'. This is an "ugly" operation from a history perspective. If you care a lot about your history, you should have a bugfix branch, where you fixed that bug, which you then merge into your topic branch (and your maintenance branch, and your master branch, etc). But if you don't care a lot about history, then just do the cherry-pick.

If you did more than fix that bug in that commit, then shame on you. You can still do the cherry-pick, but then revert the changes to files you didn't want to modify (git checkout -- <files>), add the revert, and amend your commit.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
This is why we use git add then git commit rather than just git commit -a btw

HFX
Nov 29, 2004

ColdPie posted:

You don't merge files, you merge branches. You might want to do a cherry-pick operation here. With your target branch checked out, just do: 'git cherry-pick <commit that fixes bug>'. This is an "ugly" operation from a history perspective. If you care a lot about your history, you should have a bugfix branch, where you fixed that bug, which you then merge into your topic branch (and your maintenance branch, and your master branch, etc). But if you don't care a lot about history, then just do the cherry-pick.

If you did more than fix that bug in that commit, then shame on you. You can still do the cherry-pick, but then revert the changes to files you didn't want to modify (git checkout -- <files>), add the revert, and amend your commit.

Yeah I realized the fix should have been applied somewhere else but it was discovered while making more significant chances to a larger section of code. The platform I'm working on right now makes it very hard to actually do unit testing.

ColdPie
Jun 9, 2006

I guess you might want something like:

git diff $(git merge-base branchA branchB)..branchB -- your_file > my.patch
git checkout branchA
patch -p1 < my.patch
git add your_file
git commit

Might not have the syntax totally right. This will get you the difference of that one file on branchB, then apply it to branchA and commit the change.

E: Make the example a little more clear.

E2: I guess this squashes the history of the bugfix.

ColdPie fucked around with this message at 21:07 on Jul 18, 2010

HFX
Nov 29, 2004

ColdPie posted:

I guess you might want something like:

git diff $(git merge-base branchA branchB)..branchB -- your_file > my.patch
git checkout branchA
patch -p1 < my.patch
git add your_file
git commit

Might not have the syntax totally right. This will get you the difference of that one file on branchB, then apply it to branchA and commit the change.

E: Make the example a little more clear.

E2: I guess this squashes the history of the bugfix.

Yeah, that was my only issue was losing the history on the bug fix. I might have to just suck it up at this point. Thanks guys.

king_kilr
May 25, 2007
git checkout your_branch your/file/path.txt

this will copy that branches version of this file, and replace your current directories version of it.

HFX
Nov 29, 2004

king_kilr posted:

git checkout your_branch your/file/path.txt

this will copy that branches version of this file, and replace your current directories version of it.

I don't want to replace. I want to merge. Anyway, I ended up doing it by pulling both files, doing a merge and then copying it back in to commit with a note of the merge and why.

epswing
Nov 4, 2003

Soiled Meat
I don't normally do this but...

king_kilr posted:

branches
directories

branch's
directory's

Learn and understand the difference or you'll be confusing people for generations.

Yakattak
Dec 17, 2009

I am Grumpypuss
>:3

What do you guys suggest for a web interface for SVN that also has project management type features such as tasks, timelines and whatnot? I know of websvn but it lacks the project management features I'm looking for.

spiritual bypass
Feb 19, 2008

Grimey Drawer
Trac is really great

epswing
Nov 4, 2003

Soiled Meat
Redmine integrates with SVN (and others) and does those things.

crazyfish
Sep 19, 2002

Yakattak posted:

What do you guys suggest for a web interface for SVN that also has project management type features such as tasks, timelines and whatnot? I know of websvn but it lacks the project management features I'm looking for.

I have no personal experience with it but this sounds like a job for Trac: http://trac.edgewall.org

Yakattak
Dec 17, 2009

I am Grumpypuss
>:3

Was just reading up on Trac actually. Looks like I need to test both of these and see which I like best. Thanks guys!

ColdPie
Jun 9, 2006

Speaking of maintaining consistent & clean histories in Git, this link popped up on the Git mailing list the other day, and I found it very clarifying.

http://thread.gmane.org/gmane.comp.video.dri.devel/34739/focus=34744

Yakattak
Dec 17, 2009

I am Grumpypuss
>:3

Got redmine up finally, I think it's a keeper (however it was quite a pain to get google apps setup with it for email purposes).

Anjin
Feb 25, 2001

If anyone here is using git and working with remote teams, or just want to keep track of what is going on in a project, my company has just soft-launched a new webapp https://www.utsup.com.

It allows project managers to track what people using the git project repository are doing in near real-time. We made it because we got tired of having to ask people, "what are you working on?"

It makes it really easy to monitor a team of people just by tying in a private twitter account to see all the updates come in through a constant stream, especially when you get people to start using the "sup in" command which then kicks off a process that sends out an update every 5 minutes with a file diff even if they haven't committed anything yet.

Magicmat
Aug 14, 2000

I've got the worst fucking attorneys
I'm a git newbie, so I'm still wrapping my head around the whole DVCS concept.

I have a basic project right now with the following structure
code:
        --*--*--*
       /   experimental
*--*--*
     master
I was trying to add a feature to the experimental branch and it turned into kinda a mess. I want to save what I've done, but set it aside and go back to working on the last commit of the experimental branch. Complicating things, though, is the fact that there are a few changes in the working copy I have that I want to keep in the experimental branch going forward (a bug fix here and there that I added incidentally to the feature I was adding.)

So how do I add in the changes I want to experimental, then create a new branch for the feature I'm adding (without losing what's in my working directory,) then finally go back to the clean + bugfixed experimental branch?

My only idea is to backup the whole directory somewhere, revert my working directory, diff + merge the backup & working directory to add in the bugfixes, commit, create a new branch, then copy back in all of the backup directory to the working directory, and commit to the new branch, before finally pulling from experimental again. That whole thing (with the backup directory and all) seems like a huge PITA, though. Is there a better way?

Mithaldu
Sep 25, 2007

Let's cuddle. :3:
You can put uncommitted changes into the stash, do your merging and branching, and then pop the stash back onto what you want to work with.

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
git add -i is also likely to be helpful. Basically, commit everything you want to keep in the experimental branch (even if it's not done; at worst you can later change this commit), stash everything else, make the new branch, then unstash.

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