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
ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

tef posted:

I thought about doing this for a wiki. Version control is no small amount of effort, and having a git backend (or any dcvs) does have a lot of advantages.

I figured you could just cache a lot of results for speed or otherwise. git is already handling rather large codebases with a large number of committers.

As long as the underlying dcvs was exposed, you could bypass any problems with the web interface, and many people would enjoy having the benefits of dcvs when editing pages or content, rather than the primitive options you get with web-apps.

Ikiwiki is kinda cool, yeah.

Adbot
ADBOT LOVES YOU

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

Otto Skorzeny posted:

Is there a simple way in git to have standing differences between two branches? Eg. if I want to have a release branch with a bunch of dummy config files, and a regular working branch with fleshed-out versions of those same config files, and be able to merge poo poo from the working branch to release without overwriting the release branch's config files or using cherry-pick instead of merging.

  • Prepare working branch
  • Branch from working branch to create release branch
  • Change config files in release branch, and commit
  • Make commits in working branch
  • Merge from working branch to release branch
    • If none of the working branch commits touched the config files, then the merge will not change the config files in the release branch
    • If the working branch commits changed the config files, then there will be a merge conflict for you to resolve. If these are the only merge conflicts you expect, you can just use the "ours" merge strategy to automatically resolve them by throwing away the changes from the working branch that conflict.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender
code:
$ hg diff -g -r40:41 | diffstat
Might be more what you want.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

Thermopyle posted:

Using git, how can I move all my commits since my last push to github to a new branch?

After doing a bunch of work and commits on my master branch, I decided that I need all that work to be on a new branch...

Off the top of my head...

git checkout -b newbranch creates newbranch at your current commit, and switches you to it. Then, git branch -f master origin/master moves the master branch to point at upstream's master.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

oiseaux morts 1994 posted:

It implies that C6 has two parents.
Yes, that is the case.

oiseaux morts 1994 posted:

If that were the case, which path should C6 follow?
Both of them? All of C0, C1, C2, C3, C4, and C5 are ancestor commits of the C6 commit.

oiseaux morts 1994 posted:

Or does the merge commit change the commit's parents so now C5 points to C4 points to C3?
No. Commits are never changed by anything once they are created.

oiseaux morts 1994 posted:

If so, then the iss53 branch still has C5 pointing to C3 - are commits allowed to store more than one pointer to a parent, depending on branch? Evidently not, because if I checked out C5 as a tag, then how does C5 decide to point to C4 or C3?
Commits never care how they are pointed to. A commit is a commit, regardless of if you found it by following a tag or a branch or an ancestry chain or just randomly guessing hashes or whatever.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

Suspicious Dish posted:

I wish merges and rebases were a bit better, so that if I interactively got a merge conflict, I could just say "ignore the conflicts, just pick theirs" without having to go around deleting the "<<<<<<<<<<<<"s every single time.
I think my life got a dozen times easier when I just accepted that I never want to deal with textual merge conflicts, and I set a real merge tool in my global config. I personally like diffuse, which makes it easy either examine conflicts one-by-one or to just take one entire side or the other, but I suggest you play with whatever alternatives you can get your hands on and see what you like the best; merge tools seem to be a really personal preference.

Adbot
ADBOT LOVES YOU

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

Ciaphas posted:

I'm trying to think of instances where git pull --rebase would gently caress up or be the wrong answer, and I'm coming up empty. Unless you're in a group that wants every merge commit for 100% true to life history, and nuts to that.

Speaking as someone who has git pull setup to rebase by default, I have encountered the following situation:

Your upstream looks like oldest -> older -> old. Your checkout is up-to-date with upstream.

Your coworker has been doing some work and hasn't pulled in a few hours. Their checkout looks like oldest -> unpublished.

Your coworker asks you to pull directly from their checkout and take a look at what they're doing.

What you want your repo to look like, in the best possible world: oldest -> older -> old -> unpublished (rebasing their tree to the head of your tree).

What would be acceptable, if somewhat annoying: getting an error saying that you have to do some sort of manual merge, because you have very stupidly asked to do a rebasing pull from a checkout that is not your upstream.

What git pull --rebase actually does: oldest -> unpublished -> older -> old (rebasing your tree to the head of their tree).

In summary, git pull --rebase works perfectly as long as you remember that it always moves the commits that are in your tree to be at the end of where you're pulling from. If you're pulling "unpublished" commits which should be rebased, then you need to rebase in "the other direction" that what it does by default.

That said, this is not a common situation and it's super easy to avoid.

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