|
|
Subscribe / Log in / New account

Apache Subversion 1.11.0 released

Version 1.11.0 of the Subversion source-code management system is out. Changes include improvements to the shelving feature, better resolution of merge conflicts, an experimental checkpointing feature, and more; see the release notes for details.


From:  Julian Foad <julianfoad-AT-apache.org>
To:  announce-AT-subversion.apache.org, users-AT-subversion.apache.org, dev-AT-subversion.apache.org, announce-AT-apache.org
Subject:  [ANNOUNCE] Apache Subversion 1.11.0 released
Date:  Tue, 30 Oct 2018 21:57:25 +0000
Message-ID:  <1540936645.482633.1560212888.23F1B98C__11509.4939749271$1540936522$gmane$org@webmail.messagingengine.com>
Archive-link:  Article

I'm happy to announce the release of Apache Subversion 1.11.0.
Please choose the mirror closest to you by visiting:

    https://subversion.apache.org/download.cgi#recommended-re...

This is a stable feature release of the Apache Subversion open source
version control system.

SHA-512 checksums are available at:

    https://www.apache.org/dist/subversion/subversion-1.11.0....
    https://www.apache.org/dist/subversion/subversion-1.11.0....
    https://www.apache.org/dist/subversion/subversion-1.11.0....

PGP Signatures are available at:

    https://www.apache.org/dist/subversion/subversion-1.11.0....
    https://www.apache.org/dist/subversion/subversion-1.11.0....
    https://www.apache.org/dist/subversion/subversion-1.11.0....

For this release, the following people have provided PGP signatures:

   Julian Foad [4096R/1FB064B84EECC493] with fingerprint:
    6011 63CF 9D49 9FD7 18CF  582D 1FB0 64B8 4EEC C493
   Branko Čibej [4096R/1BCA6586A347943F] with fingerprint:
    BA3C 15B1 337C F0FB 222B  D41A 1BCA 6586 A347 943F
   Stefan Sperling [2048R/4F7DBAA99A59B973] with fingerprint:
    8BC4 DAE0 C5A4 D65F 4044  0107 4F7D BAA9 9A59 B973
   Daniel Shahaf [3072R/A5FEEE3AC7937444] with fingerprint:
    E966 46BE 08C0 AF0A A0F9  0788 A5FE EE3A C793 7444
   Johan Corveleyn [4096R/B59CE6D6010C8AAD] with fingerprint:
    8AA2 C10E EAAD 44F9 6972  7AEA B59C E6D6 010C 8AAD

Release notes for the 1.11.x release series may be found at:

    https://subversion.apache.org/docs/release-notes/1.11.html

You can find the list of changes between 1.11.0 and earlier versions at:

    https://svn.apache.org/repos/asf/subversion/tags/1.11.0/C...

Questions, comments, and bug reports to users@subversion.apache.org.

Thanks,
- The Subversion Team

--
To unsubscribe, please see:

    https://subversion.apache.org/mailing-lists.html#unsubscr...


to post comments

Hmm …

Posted Oct 31, 2018 20:37 UTC (Wed) by smurf (subscriber, #17840) [Link] (74 responses)

This may be a stupid question, but is there any SVN feature that git doesn't have a superset of?

Hmm …

Posted Oct 31, 2018 20:48 UTC (Wed) by aleXXX (subscriber, #2742) [Link] (20 responses)

Easy to use, no chance to destroy the repository :-)

Hmm …

Posted Oct 31, 2018 21:32 UTC (Wed) by smurf (subscriber, #17840) [Link] (16 responses)

I'd debate "easy to use" – and there are not many ways to mangle a git repository that "git reset --hard" doesn't get you out of.

Hmm …

Posted Nov 2, 2018 16:15 UTC (Fri) by nix (subscriber, #2304) [Link] (15 responses)

Indeed thoughtlessly doing a 'git reset --hard' when you forgot that your working tree actually had uncommitted work in it is probably the single most common way of losing data with Git. Once it's committed, it's *hard* to lose. (You'd need to delete or rewrite the branch then wait at least the gc.reflogExpire time plus however long it takes for the next GC to run.)

Hmm …

Posted Nov 2, 2018 21:15 UTC (Fri) by epa (subscriber, #39769) [Link] (14 responses)

My favourite way to lose data with git is ‘git checkout’. It will overwrite files in the working tree without warning. Coming from svn, I miss a command which recreates any missing files but leaves other local changes alone.

People often note that git takes care with its repository, and it’s hard to lose data from it permanently. But git is lot more cavalier with files in the working copy — at least more so than you might expect from a common command ‘checkout’. (‘git overwrite’ or something would be fine)

Hmm …

Posted Nov 2, 2018 21:24 UTC (Fri) by pizza (subscriber, #46) [Link] (13 responses)

> My favourite way to lose data with git is ‘git checkout’. It will overwrite files in the working tree without warning. Coming from svn, I miss a command which recreates any missing files but leaves other local changes alone.

If you say 'git checkout foo.c' doesn't that count as explicitly telling git that you want to overwrite 'foo.c'?

If you say 'git checkout tagname' when foo.c has local modifications, by default git will report an error ("foo.c has local modifications" or something like that) and not overwrite the file.

> People often note that git takes care with its repository, and it’s hard to lose data from it permanently. But git is lot more cavalier with files in the working copy

Commit early, commit often. You can always slice and dice using 'git rebase'. Or use 'git stash' before potentially destructive operations.

Hmm …

Posted Nov 4, 2018 17:52 UTC (Sun) by epa (subscriber, #39769) [Link] (12 responses)

It's more about 'git checkout .' which will silently overwrite every local change in the working copy. I would have expected it to prompt on overwrite, or at least have an option to do so (like cp -i or mv -i).

Perhaps the fault is with whoever recommended 'git checkout .' as the way to recover, from the current commit, files deleted in the working copy. (With svn I would do 'svn update' for that, which is reasonably safe.) But then, what is the safe git command to bring back deleted files while not trashing local changes in others?

Hmm …

Posted Nov 4, 2018 19:03 UTC (Sun) by smurf (subscriber, #17840) [Link] (3 responses)

> It's more about 'git checkout .' which will silently overwrite every local change in the working copy.

That depends on whether you want to get a single file (or three), or go to a different commit. The latter refuses to overwrite things.

> what is the safe git command to bring back deleted files

There is none. If you overwrite a file that hasn't been checked in, it's gone, just like when you use "rm". In fact, if you try to "git rm" a modified file, it'll warn you.

Adding a warning option does make sense; I'll file a feature request.

Hmm …

Posted Nov 4, 2018 20:11 UTC (Sun) by madscientist (subscriber, #16861) [Link]

Note the OP includes a "." at the end of the git checkout command:

> It's more about 'git checkout .' which will silently overwrite every local change in the working copy.

Adding a "." causes a checkout of all (modified) files from the current directory down. It cannot go to a different commit.

For me, if I want to un-modify a file I use "git status" to see a list of modified files, and "git checkout filex filey ..." (perhaps copy/paste) to check out specific files. If I want to throw away everything I use "git reset --hard HEAD" or similar. I virtually never use "git checkout <directory>" and wouldn't suggest it to others, either.

> what is the safe git command to bring back deleted files

By this I assume you mean a committed file that you have deleted and then want to recover and not an untracked file that you've deleted.

The best way to know how to solve almost ANY issue in a workspace is to run "git status" and it will tell you how to undo it. For example, if you "rm somefile" and then decide you want it back, "git status" will tell you:

> Changes not staged for commit:
> (use "git add/rm <file>..." to update what will be committed)
> (use "git checkout -- <file>..." to discard changes in working directory)

> deleted: Demo/readme.txt

If you use "git rm somefile" then decide you want it back, "git status" will tell you:

> Changes to be committed:
> (use "git reset HEAD <file>..." to unstage)

> deleted: Demo/readme.txt

And finally when in doubt, I use "git stash" to stash modified files before doing any kind of bizarre operations on a repository where there are modifications I want to preserve, just in case.

Hmm …

Posted Nov 5, 2018 6:59 UTC (Mon) by epa (subscriber, #39769) [Link] (1 responses)

No, what I mean is when you 'rm' a file or two in the working copy and then you want to restore those files from the current commit (or from git's index, if they happen to be in there).

'git checkout .' will appear to work for this task but it is highly dangerous, since it unconditionally trashes any other local changes. As another poster noted, there doesn't seem to be a command which does it, short of running 'git status', looking for 'deleted' lines, and running 'git checkout' over those.

Now, you may say that this isn't a sensible way to work, and the right way to revert changes in a file if you messed it up is to run 'git checkout FILE' directly. Not to just delete the file and then hunt for the right incantation to bring it back. But rightly or wrongly it is a natural human reaction to say "I really messed this up, let's just delete it and start again".

I did raise the feature request on the mailing list: https://public-inbox.org/git/loom.20150603T104534-909@pos...

Hmm …

Posted Nov 13, 2018 22:51 UTC (Tue) by arnout (subscriber, #94240) [Link]

> No, what I mean is when you 'rm' a file or two in the working copy and then you want to restore those files
> from the current commit (or from git's index, if they happen to be in there).

You might want to give 'git checkout -p' a try.

Hmm …

Posted Nov 6, 2018 15:55 UTC (Tue) by jezuch (subscriber, #52988) [Link] (2 responses)

One small nit: "git checkout <path>" will trash all changes that are not in the index (AKA staging area). I use it all the time to trash only select changes: "git add -p" and then "git checkout ." usually followed by "git reset". It's very powerful. But you need to have total situational awareness of your working copy for this to work without surprises.

Hmm …

Posted Nov 6, 2018 20:09 UTC (Tue) by epa (subscriber, #39769) [Link] (1 responses)

Yes, that's the core of my complaint: it sounds a lot more innocuous than it is. If it were called 'git overwrite-local-changes' there wouldn't be any issue. I think that being called 'checkout' it should prompt a bit more before trashing multiple files.

Hmm …

Posted Nov 11, 2018 18:37 UTC (Sun) by jezuch (subscriber, #52988) [Link]

I agree that names could be better. This is one more illustration of evolution over intelligent design ;) But after a while of using git it's all just... identifiers.

Hmm …

Posted Nov 6, 2018 20:14 UTC (Tue) by neilbrown (subscriber, #359) [Link] (4 responses)

> It's more about 'git checkout .' which will silently overwrite every local change in the working copy.

Anyone want to write a patch which causes "git checkout" (and anything else potentially destructive) to do an automatic "git stash" first ???

Hmm …

Posted Nov 11, 2018 17:58 UTC (Sun) by Wol (subscriber, #4433) [Link] (1 responses)

And how is that going to help us noobs (who don't have a great understanding of git)?

I tend to use git with a bit of a cookbook aide-memoir, I have an understanding of what's going on but it's not particularly good. An automatic "git stash" will be a pretty good way of helping me lose stuff, because I haven't yet got to grips with what stash actually does. Yes I know it puts stuff "somewhere safe", but as it is at home, "somewhere safe" usually equates to "I've forgotten where I put it" ie I've lost it.

Cheers,
Wol

Hmm …

Posted Nov 11, 2018 21:59 UTC (Sun) by neilbrown (subscriber, #359) [Link]

> And how is that going to help us noobs (who don't have a great understanding of git)?

The best way to help noobs like you is through education.
An important part of education is encouraging exploration and experimentation.

If something goes wrong and you try to fix it up and fail, and then post in some community "Hi, X happened so I tried Y and now Z", then someone says "Oh no, never try Y - that is a disaster, I hope you have backups" - then you might not want to experiment again.
If, instead, they could say "Y probably wasn't the best approach, but git has your back - just run this simple command and look through the resulting log until you see the code you lost - then do Q to recover it" - you might be more likely to experiment more next time.

So I agree that auto-git-stash is not a complete solution, but it does seem that it would still be valuable.

Hmm …

Posted Nov 14, 2018 8:29 UTC (Wed) by jezuch (subscriber, #52988) [Link] (1 responses)

There *is* autostash but I haven't used it so I don't know what it does or when :)

Hmm …

Posted Nov 14, 2018 15:28 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

It's just used during `git rebase` (AFAIK). It stores your local diffs until the rebase is over and then applies them (keeping them in the stash if there are conflicts). It also comes into play when using `git pull --rebase`.

Hmm …

Posted Nov 3, 2018 14:31 UTC (Sat) by mgedmin (subscriber, #34497) [Link] (2 responses)

Let me tell you of the time Subversion managed to mess up the repository so badly it started eating all the RAM on the server until the OOM killer had to kill the svnserve. (Somehow the delta compression of the svn:ignore property on my SVN-versioned home directory ended up with a loop in the data structures.)

To recover the repo I had to hack the subversion source code and have it ignore the bad deltas, dump, then load everything afresh.

Git never caused me such pain.

Hmm …

Posted Nov 9, 2018 19:53 UTC (Fri) by mathstuf (subscriber, #69389) [Link] (1 responses)

One class in college had a shared SVN repo for the whole class. Some enterprising soul managed to commit `.svn` to the repo. How? I have no idea. But the server was decided unhappy with the situation.

Hmm …

Posted Nov 9, 2018 22:07 UTC (Fri) by flussence (guest, #85566) [Link]

I once spent some time using git-svn to work with an ancient subversion server (for practical reasons - the git clone was much smaller on disk and `git commit` was about 15 minutes faster than `svn ci`).

That didn't last unfortunately; somehow it led to the svn server writing corrupt metadata to its own DB that it couldn't read, and I ended up spending a day to repair it by hand.

(Maybe this anecdote says more about the working conditions at that gig than SVN, but it was still an unpleasant bug to run into.)

Hmm …

Posted Oct 31, 2018 21:15 UTC (Wed) by excors (subscriber, #95769) [Link] (1 responses)

Some SVN features I've found useful:

Decent support for frequently-changing large binary files, so users don't need disk space for more than a couple of copies of them, as a standard feature so it works with all SVN clients.

Checkouts(/clones) that don't have to be restarted from the beginning if the connection gets lost partway through, as a standard feature that doesn't need significant extra infrastructure and scripting to get it working (like Git bundles).

Fine-grained access control - you can allow different users to read and write different overlapping subsets of the repository.

Hmm …

Posted Oct 31, 2018 21:57 UTC (Wed) by epa (subscriber, #39769) [Link]

Possibly, too, the ability to check out just a particular subdirectory of the repository.

Hmm …

Posted Oct 31, 2018 22:44 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

A couple:
1) Locking.
2) Checking out a part of the repo.

Both are surprisingly useful for art development.

Hmm …

Posted Nov 1, 2018 11:48 UTC (Thu) by nazgulos (subscriber, #66348) [Link]

I would also add that:

2) Checking out a part of the repo

can be very useful in software development too.

Especially if you want to use some library code and don't want to pull all tests or other stuff.

Hmm …

Posted Nov 1, 2018 9:47 UTC (Thu) by tzafrir (subscriber, #11501) [Link] (8 responses)

You can easily convert the commit (revision) number to a version number. With git the only alternative I'm aware of is to use dates. This is longer and not as nice and simple (as you would expect from a decentralized system).

Hmm …

Posted Nov 1, 2018 11:49 UTC (Thu) by ballombe (subscriber, #9523) [Link] (7 responses)

With git you can use git-describe.

Hmm …

Posted Nov 1, 2018 14:58 UTC (Thu) by tzafrir (subscriber, #11501) [Link] (5 responses)

You could. Theoretically. In Subversion the value you get fits nicely inside an integer. In git this value is hardly ever used for versioning (It probably is used, but I don't recall it being used in snapshot release names. People normallyuse date/time and hope this is a good enough ID).

And no. I don't miss Subversion.

Hmm …

Posted Nov 1, 2018 18:53 UTC (Thu) by nybble41 (subscriber, #55106) [Link]

> In Subversion the value you get fits nicely inside an integer.

Really? I mean, anything can be encoded into an integer, technically—Git commit IDs are just integers after all even if they are represented as hex strings—but I wouldn't say the base version of an arbitrary Subversion repository "fits nicely inside an integer" given its support for mixed-revision working copies and independently-versioned external references:

> $ svnversion
> 3500:4122M

That doesn't even tell you *which* parts of the working copy are from each revision, just the lowest and highest revision IDs.

Even without mixed revisions, externals, or local modifications, a single revision ID is not enough to recreate the state of the working copy: you also need to identify the repository URL and the path of the branch. Contrast that with a Git commit ID, which uniquely identifies both the content of the checkout and its history.

> It probably is used, but I don't recall it being used in snapshot release names.

I have at least 45 packages installed on my Debian system right now which use the Git commit ID as part of the package version. IIRC if you build a kernel from the Debian source package it uses the Git commit ID by default as part of the kernel version.

Hmm …

Posted Nov 1, 2018 21:03 UTC (Thu) by smurf (subscriber, #17840) [Link] (3 responses)

So SVN has monotonically-increasing version numbers. Surprise, you can do exactly the same thing on your git server if you're so inclined.

The question is, why would you want that. Unique version idenifiers do not need to be monotonic, and in most (of not all) projects not every commit needs a monotonically-increasing version number – just those you're releasing.

Hmm …

Posted Nov 2, 2018 13:56 UTC (Fri) by k8to (guest, #15413) [Link] (1 responses)

It turns out it's a really useful thing to be able to sort version numbers.

It's really useful for users, it's really useful for troubleshooting by providers, etc. Not everyone needs this property, and there are other ways to be able to deal with unsortable version numbers that are more annoying.

It's weird how many people seem to be willing to deny this utility. It's not an overwhelming concern, but it is quite useful.

Hmm …

Posted Nov 3, 2018 14:36 UTC (Sat) by mgedmin (subscriber, #34497) [Link]

I get the impression people in this thread aren't familiar with `git describe`, so here's what it gives you:

<last-version-tag-on-this-branch>-<number-of-commits-since-that-tag>-g<sha1-of-the-last-commit>

The first parts ensure that version numbers produced by `git describe` are monotonically increasing (assuming you tag your versions in a sensible way), and the last part ensures anyone can quickly locate the right commit if they want to.

Hmm …

Posted Nov 2, 2018 15:27 UTC (Fri) by tzafrir (subscriber, #11501) [Link]

I suspect git had to develop 'bisect' early on for a reason. With Subversion, manual bisecting is simpler than in git (but sure, git bisect is much nicer than manually bisecting).

Version numbers

Posted Nov 4, 2018 9:32 UTC (Sun) by tialaramex (subscriber, #21167) [Link]

As an example the Haiku operating system project adopted git reluctantly and the old guard pushing back insisted they import their practice of assigning monotonically increasing revision numbers, so every single push to their online repo (I believe the github mirror lacks this) has a git tag 'hrevN' where N is a monotonically increasing integer.

Now, fortunately (?) for them Haiku is developed rather slowly, after 17 years they have only just over 50 000 of these revisions, the number would be pretty out of control for a project like Linux - but this approach is definitely viable for your own small projects where revisions above 1000 aren't likely.

But one other notable thing about Haiku is that development has proceeded in a largely linear fashion for those 17 years. Git makes branching easy, but Haiku's politics make it hard; there is a clear mandate for the project's original concept (reproduce the 1990s BeOS R5) but beyond or outside of that things quickly get sketchy. So there's an uneasy process whereby other changes, orthogonal to that concept, either get accepted into their mainline warts and all very early, or are abandoned and decay quietly.

Haiku branched for Haiku R1 Beta 1 back in September, but there are no monotonically increasing revision numbers on that branch, it's just all labelled "Haiku R1 Beta 1" without distinguishing.

Hmm …

Posted Nov 1, 2018 17:48 UTC (Thu) by flussence (guest, #85566) [Link]

WebDAV compatibility. Not something many people would find a use for, but it was there.

Hmm …

Posted Nov 2, 2018 22:07 UTC (Fri) by moltonel (subscriber, #45207) [Link] (20 responses)

* Fixing a bug in all your maintained branches with the same commit.
* Working with multiple branches in parallel without having to worry about checkout or stash.

Hmm …

Posted Nov 3, 2018 12:42 UTC (Sat) by nix (subscriber, #2304) [Link] (4 responses)

* Working with multiple branches in parallel without having to worry about checkout or stash.
'git worktree' fixes that completely. :)

Hmm …

Posted Nov 3, 2018 22:22 UTC (Sat) by moltonel (subscriber, #45207) [Link] (3 responses)

On paper yes, but when I've tried to use it in the past, `git worktree` brought all kinds of akward edge cases. In the end, I'm still making everyday use of `cp -a $BRANCH1 $BRANCH2` to handle multiple branches.

I don't miss having to contact a server for half my vcs operations, but I do miss a vcs that is clear and easy to use, rather than a footgun that's more complicated than my programming language.

Hmm …

Posted Nov 4, 2018 10:02 UTC (Sun) by smurf (subscriber, #17840) [Link] (2 responses)

I'd recommend "git clone --local". Or even "--shared".

Hmm …

Posted Nov 16, 2018 22:47 UTC (Fri) by aleXXX (subscriber, #2742) [Link] (1 responses)

Here we see one issue of git in action.
Somebody raises an issue or question, and thi starts a discussion between git experts who all propose different non-obvious git commands.

Hmm …

Posted Nov 17, 2018 11:02 UTC (Sat) by moltonel (subscriber, #45207) [Link]

In this case they're not too hard to find, I know I tried them myself to solve the "work with multiple branches in parallel" problem. It's just that they all have drawbacks and in the end, `cp -a` works better for me.

It's worse with the "proper file rename support" problem though: in that case all the experts had to propose were ways to split/group two rename/modify commits together, which are not only horribly complicated, but don't solve the actual problem. The workaround of separating commits into a "pure rename commit" and "the rest of the commit" (whatever the level of automation) is really not satisfying.

Hmm …

Posted Nov 4, 2018 10:39 UTC (Sun) by smurf (subscriber, #17840) [Link] (5 responses)

> * Fixing a bug in all your maintained branches with the same commit.

So what happens when another branch has changed the same line?

In git, the whole point of one commit is that it completely and unambiguously describes one particular state of your work (and its history). So "all branches with the same commit" doesn't even mean anything.

It's reasonably easy to write a post-commit hook that auto-applies your change to all other branches – including handling merge conflicts.

Hmm …

Posted Nov 4, 2018 17:46 UTC (Sun) by moltonel (subscriber, #45207) [Link] (4 responses)

An svn commit is actually better at "completely and unambiguously describ[ing] one particular state of your work (and its history)" than a git commit, because it encompasses all the repo's branches, not just the branch(es) the commit belongs to. Also because there's only one canonical repo (the one on the server), but that's another story.

Commiting to multiple branches is indeed meaningless for git, but it's natural for svn, and a useful feature for a vcs in general.

To me, the issue isn't about how to apply the commit to multiple branches (script, cherry-pick, patch, manual, etc...) it's about ending up with proper coherent cross-branch history. There's a single point in the commit logs where you see the fix applied, it's easy to check which branches it got applied to, and there's no risk to checkout the fix for one branch but not another.

It's not a must-have that would make me stick with svn, but it's definitely something that felt like a downgrade when switching to git.

Hmm …

Posted Nov 5, 2018 12:29 UTC (Mon) by anselm (subscriber, #2796) [Link] (2 responses)

An svn commit is actually better at "completely and unambiguously describ[ing] one particular state of your work (and its history)" than a git commit, because it encompasses all the repo's branches, not just the branch(es) the commit belongs to.

That depends on your philosophy. Svn operates in terms of tree snapshots while git operates in terms of changesets. With git, it is straightforward to see which sequence of changesets has resulted in the current state (“branch”), and it could be argued that the exact state and provenance of other branches actually isn't that important at that point. Svn gives you the “big picture” and of course that may also have its advantages every so often. OTOH, in git, a “branch” is a much more lightweight object than in svn, and that encourages the use of single-feature branches where you end up with a whole lot of them.

Git also makes it easier to transplant changesets from one branch to another after the fact, or to publish or consume them remotely, and that of course is at the root of the whole “decentralised” thing that svn doesn't really address at all. Working with git, I find myself doing rebases and fixups quite a lot just to keep the development history of my code nice and logical, and unless svn has improved considerably in that area since I used it I have no idea at all how I would do that with svn.

Hmm …

Posted Nov 5, 2018 18:47 UTC (Mon) by johill (subscriber, #25196) [Link] (1 responses)

> Svn operates in terms of tree snapshots while git operates in terms of changesets.

Hm. I think that came out wrong?

git doesn't really care about the changes at all, each commit just records the current state of the tree and the parent commit.

Perhaps you meant to say something else?

(FWIW, I've (ab?)used this property of git to great effect in some projects, e.g. tracking an automatically modified version of one tree in another, where you just have to provide a tree->tree mapping "function", and then git will sort out everything else basically by itself)

Hmm …

Posted Nov 12, 2018 16:26 UTC (Mon) by mathstuf (subscriber, #69389) [Link]

> (FWIW, I've (ab?)used this property of git to great effect in some projects, e.g. tracking an automatically modified version of one tree in another, where you just have to provide a tree->tree mapping "function", and then git will sort out everything else basically by itself)

This is what we do to track third-party library imports in our projects. We take the upstream tree, select out files we want and then `git merge -Xsubtree=import/path/` into the "right place" in the project tree. There are then commit checks to ensure that all changes do that subdirectory are done via the importing process.

Hmm …

Posted Nov 9, 2018 19:55 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

We do this by having a `Backport: <branch>` trailer in the description of the merge request which the merge robot then takes and merges into the required branches. The full syntax is `Backport: branch:committish` where `HEAD` is replaced by the commit at the top of the MR. Need to resolve a conflict? Merge on your MR branch and then do `Backport: release:HEAD^2` to get the release fix into that branch.

Hmm …

Posted Nov 4, 2018 13:18 UTC (Sun) by niner (subscriber, #26151) [Link] (8 responses)

Isn't cherry-picking a commit into all branches pretty much a 3 line script? I wonder how subversion could simplify that by much.

Hmm …

Posted Nov 4, 2018 16:03 UTC (Sun) by farnz (subscriber, #17727) [Link] (7 responses)

svn commit -m"Emergency fix of all bad lock creators" and you've committed to all branches simultaneously. Record the SVN revision that you've just created, and blacklist all binaries built from a lower numbered revision, and you're able to blacklist all binaries that don't contain the fix.

This is (inevitably) harder in any VCS that supports real branches (as opposed to the in-VCS copies that SVN does) and that has a distributed notion of ancestry (as opposed to a central server assigning revision numbers).

Hmm …

Posted Nov 4, 2018 16:12 UTC (Sun) by niner (subscriber, #26151) [Link] (1 responses)

Oh but that means one still has to apply the actual patch to each branch individually with no support by the VCS at all, doesn't it?

It's been so long since I've used subversion that I totally forgot how little support it has for actual branches.

Hmm …

Posted Nov 4, 2018 16:24 UTC (Sun) by farnz (subscriber, #17727) [Link]

Well, depends on the patch - you can checkout all branches simultaneously and just tell Coccinelle or similar semantic patch software to fix all branches at once.

Hmm …

Posted Nov 4, 2018 17:28 UTC (Sun) by smurf (subscriber, #17840) [Link] (4 responses)

> svn commit -m"Emergency fix of all bad lock creators" and you've committed to all branches simultaneously

??? in my book this commits only to the branch you're currently on (or the trunk).

> This is (inevitably) harder in any VCS that supports real branches (as opposed to the in-VCS copies that SVN does)
> and that has a distributed notion of ancestry (as opposed to a central server assigning revision numbers).

This is not true for a VCS that tracks merges. With git, you'd patch the first commit your fix could reasonably apply to, record the commit ID of that change, and then blacklist every build that does not have this ID as an ancestor. In other words, a one-liner.

Hmm …

Posted Nov 4, 2018 18:03 UTC (Sun) by farnz (subscriber, #17727) [Link] (3 responses)

There is no such thing as a branch in SVN; by convention only, the root of the repository contains three directories, "tags", "branches" and "trunk". You are quite at liberty to check out the root and thus have all branches plus all tags plus trunk in a single working copy, and to commit a single commit across branches, tags and trunk at once.

And your git one-liner misses the point; I have build r23456 on my system. Commit r23440 fixed the world. This is all the information I need to know precisely whether or not I have the fix. In contrast, in git, I need a full ancestry tree - how else do I know if product1-v2.1-12-gabcdef is ahead of or behind product2-v9.1-45-gdefabc?

Hmm …

Posted Nov 4, 2018 20:36 UTC (Sun) by smurf (subscriber, #17840) [Link] (1 responses)

Sure I can check out everything at once. But (a) people usually don't work that way, (b) that also means that I can break everything at once. Guess what I, wearing my management hat, don't want to enable people to do – there's a reason we now have CI systems that run mandatory test suites before allowing anybody to check their "bug fix" into the release or CD branch.

Yes, you need an ancestry tree (not a full one – just one that goes back to the parent of the bugfix) if you do this with git. Surprise: You are most likely to already have it. In any case, there are other ways; one no-brainer method is an entry in a BUGS_FIXED file you'd check. Another would be a test suite that actually verifies that the bug is (and stays) gone.

Hmm …

Posted Nov 5, 2018 8:18 UTC (Mon) by farnz (subscriber, #17727) [Link]

Sure, people don't normally work that way - but in special cases, you can do that if you have to.

And I'm surprised that you think that ordinary customers on the phone have the test suites, a full ancestry tree and the ability to query that tree. That's not my experience anywhere - and in the sort of place where you fix all branches at once, you probably also have customers with special case branches with a per-customer fix on it. In that case, a BUGS_FIXED file isn't helpful - it'll cover all the cases you've thought about, but not the special cases.

Also, this isn't about whether or not this is good practice (small shops do all sorts of things that aren't good practice!) - it's whether or not there's anything that git can't do that SVN can. This is something that SVN can do, partly by virtue of not being as complete a VCS, that git can't do.

Hmm …

Posted Nov 7, 2018 13:53 UTC (Wed) by Wol (subscriber, #4433) [Link]

> There is no such thing as a branch in SVN; by convention only, the root of the repository contains three directories, "tags", "branches" and "trunk". You are quite at liberty to check out the root and thus have all branches plus all tags plus trunk in a single working copy, and to commit a single commit across branches, tags and trunk at once.

Problem is, there's no such thing as a root in git. That's the whole point of a DVCS :-) The only reason Linus' tree is the root for linux is that everybody agrees that it is.

Having worked with Visual Sourcesafe, and with git, git is so much simpler because you're not stepping on other peoples' toes all the time :-)

Cheers,
Wol

Hmm …

Posted Nov 4, 2018 18:32 UTC (Sun) by moltonel (subscriber, #45207) [Link] (17 responses)

While we're at it, is support for explicit file rename in git still on the horizon, or is 'git mv' deemed good enough ? The heuristic algorithm still gets it wrong regularly.

Hmm …

Posted Nov 4, 2018 20:05 UTC (Sun) by mpr22 (subscriber, #60784) [Link] (16 responses)

How often does the heuristic get it wrong if you don't make life impossible for it by making wholesale changes to the file in the same commit that you rename it?

Hmm …

Posted Nov 5, 2018 13:53 UTC (Mon) by NAR (subscriber, #1313) [Link] (15 responses)

For some languages the filename and the "module/class name" in the file must be the same, otherwise the code doesn't even compile. Only renaming a file, but not changing it leads to broken build - so if we want all commits to be able to be built, the file has to be modified at the same time as it's being renamed and sometimes git doesn't notice that it's a file rename :-(

Hmm …

Posted Nov 5, 2018 17:33 UTC (Mon) by ms-tg (subscriber, #89231) [Link] (13 responses)

Yes, I was just about to type the same reply. The git mv heuristic's most inconvenient failure case is the one you mentioned -- when renaming a source file also implies that you must change the naming inside the files. Considering how very common this really is across widely used programming languages, I'm also surprised that this is still an issue today.

Instead of doing what seems semantically correct, we instead must:
1. Locally git commit nothing more than the 'git mv OLDNAME NEW NAME'
2. Locally git commit the naming change inside the file and all referring files

And note in the commit history that commit (1) doesn't actually work, but is kept separate so that git can identify the rename in the history.

Does anyone have a better standard practice for the above today?

Hmm …

Posted Nov 5, 2018 19:47 UTC (Mon) by epa (subscriber, #39769) [Link] (12 responses)

I often miss the ability to group commits in git -- so one top-level commit could be unpacked into smaller ones if you choose to view it that way (and those smaller ones themselves could be nested commits, etc).

That would take care of the 'doing this commit just so git doesn't become confused' problem and it would also help with patch sets and work on a particular feature -- where the whole work is merged as a single logical commit, but by bumping up the default nesting level you can drill down to the component changes. You can emulate this a little bit with branching and merging (where there is a single commit merging the feature branch) but it's clunky by comparison.

Hmm …

Posted Nov 6, 2018 3:06 UTC (Tue) by neilbrown (subscriber, #359) [Link] (7 responses)

In what way is it "clunky by comparison"?
Would it require changes in the git engine to achieve what you want, or would it be sufficient to add some commit-group-aware interfaces?

Hmm …

Posted Nov 6, 2018 12:00 UTC (Tue) by epa (subscriber, #39769) [Link] (6 responses)

I suspect that no new low-level machinery would be needed; instead a special type of commit declares the previous N commits (with the given SHAs) to have been part of a group, with a certain log message. 'git bisect' could become aware of groups (bisecting at top-level granularity first, then optionally breaking down to the next level to find the particular sub-commit, and so on) and 'git rebase -i' would need to show them somehow, and do something reasonable when you want to rewrite history changing the contents of a group. Then web interfaces like Github would let you review the grouped commit with an ability to click through to see the sub-commits it contains.

Perhaps all this could be done with tags, I'm not sure -- but I like the idea that groups are immutable once created (just like ordinary commits), yet at the same time you can push a new group-declaring commit retrospectively making some previous commits part of your group. (I think it might be wise to forbid group spaghetti where a commit can be part of two overlapping groups, except for the straightforward case of nesting. That is something a git hook could take care of. The git machinery itself doesn't really get affected by that, however.)

Hmm …

Posted Nov 6, 2018 13:45 UTC (Tue) by smurf (subscriber, #17840) [Link]

IMHO a group marker shouldn't mark the "previous N commits" to be a group (that won't work if one of these is itself a merge to something "outside" the group) – instead, it should declare a specific ancestor to be the one that's displayed when the group is collapsed.

That special-ness could be even signalled without touching the core data structure: a normal no-follow merge commit mentions its parents in a specific order (the "null" parent is first). A "this is a group" commit would simply invert that.

Hmm … commit groups

Posted Nov 6, 2018 23:02 UTC (Tue) by neilbrown (subscriber, #359) [Link]

From a pragmatic perspective (rather than aesthetic) you seem to have identified two particular elements of functionality.

For the moment I'm thinking of a group as a merge commit plus all the commits on the right side of the merge that aren't also on the left (for some reasonable understanding of "left" and "right").

1/ you want "git bisect" to recognise these merge points and preferentially test those, rather than commits on the right. I suspect it would be fairly easy to do this for all merges. It would be expected to increase the number of steps a little, but probably just by one or two.

2/ you want to allow a new commit to mark an existing commit as part of it's group. This is comparatively huge. For git-bisect to be able to notice, you would need to create some sort of index from child commits back to their parents, at least for merged commits.
Between 4.1 and 4.19 (just a random sample) there are 20808 merge commits and 232659 non-merges. That means about 10% of commits are merges. Adding an index for the children of all merges should be manageable. If it was just "all merges with some magic string in the message" it would be even more manageable. I'm not sure if that is quite enough to allow git-bisect to do what we want.

I've occasionally thought this would be good for patches labeled "Fixes:". If they were attached to the patch they fix in a way that git-bisect could detect, then maybe it could always pull in fix - or a least warn that a fix was missing.

I think there are ideas worth exploring here (if only I had the time).

Hmm …

Posted Nov 9, 2018 19:52 UTC (Fri) by mathstuf (subscriber, #69389) [Link] (3 responses)

> 'git bisect' could become aware of groups (bisecting at top-level granularity first, then optionally breaking down to the next level to find the particular sub-commit

I think this would be handled well with a `git bisect --first-parent` option which bisects the first-parent history and then starts bisecting the history between the two commits recursively on the remaining history using the same first-parent semantics. Then your "groupings" are exactly merges.

Hmm …

Posted Nov 12, 2018 4:17 UTC (Mon) by neilbrown (subscriber, #359) [Link] (2 responses)

> I think this would be handled well with a `git bisect --first-parent` option ...

What version of git do you need? Do you give "--first-parent" when you "git bisect start" or on every "git bisect good/bad"??

"revision.c" in current git contains the line

revision.c: die(_("--first-parent is incompatible with --bisect"));

which makes me wonder....

Hmm …

Posted Nov 12, 2018 8:26 UTC (Mon) by smurf (subscriber, #17840) [Link]

> which makes me wonder....

If you only do first-parent then you may end up at the point where your only possible refinement is to start bisecting a group, which you forbade git to do – after all, you used "--first-parent".

Thus, this situation requires additional code – which hasn't been implemented yet.

Hmm …

Posted Nov 12, 2018 16:24 UTC (Mon) by mathstuf (subscriber, #69389) [Link]

I'd say you just give it to `git bisect start`. Offhand, I imagine it could basically treat all non-first-parent commits as `skip`. When it finds out that it is one of the X auto-skipped commits, it unmarks the first-parent history of those candidate commits and then restarts the bisect on those commits.

Hmm …

Posted Nov 6, 2018 6:28 UTC (Tue) by smurf (subscriber, #17840) [Link] (3 responses)

Grouping commits is reasonably simple – you create a branch for them, and then do a non-fast-forward merge to the parent.

Hmm …

Posted Nov 6, 2018 7:08 UTC (Tue) by epa (subscriber, #39769) [Link] (2 responses)

Yes, as I mentioned you can get some of the benefits by merging a branch in one commit. But that forces a nonlinear history, while allowing nested changes would still give a linear timeline for bisecting, etc.

Also it only really gives one level of nesting and is a bit clunky. Take for example the problem mentioned in an earlier post. To rename a file you may first do ‘git mv’ in one commit then change the contents in the next. Does anyone really land a separate branch just for that? What I envisage is something like ‘git group open; git commit; ...; git group close’. On closing the group you are prompted for a top-level commit message. Or you could group commits when rebasing. This would be similar to the current support for squashing commits into one, but still allowing the individual changes to be retrieved if you choose to ‘look inside’.

Hmm …

Posted Nov 6, 2018 19:44 UTC (Tue) by MrWim (subscriber, #47432) [Link] (1 responses)

Put this in git-group.sh, mark it executable and run git config --global alias.group '!/path/to/git-group.sh'. You will then be able to run git group open and git group close. It's a quick and dirty hack, with precious little error handling, but it will support nesting and should be convenient to use.

If you want to get a log with these groups collapsed run git log --first-parent.

git-group.sh follows:

#!/bin/sh -e

fail() {
    echo $@ >&2
    exit 1
}

current_branch=$(git symbolic-ref --short HEAD)

cmd=$1
shift

case "$cmd" in
open)
    git checkout -b ${current_branch}-group
    ;;

close)
    parent=$(echo $current_branch | sed 's/-group$//')
    [ "$parent" != "$current_branch" ] || fail "Not in a group!"
    git checkout "$parent"
    git merge --no-ff --no-commit --log "$current_branch" --edit
    printf '# Enter top-level commit message here.  Sub-commit messages follow:\n\n' >.group_commit_msg
    git log --first-parent --format=%B "${parent}...${current_branch}" >>.group_commit_msg
    git commit --file .group_commit_msg --edit
    rm .group_commit_msg
    git branch -D "$current_branch"
    ;;

*)
    fail "Unknown command $cmd"
    ;;
esac

Hmm …

Posted Nov 6, 2018 20:08 UTC (Tue) by epa (subscriber, #39769) [Link]

Thanks!

Hmm …

Posted Nov 7, 2018 11:12 UTC (Wed) by jezuch (subscriber, #52988) [Link]

If there is only one line changed then git will almost certainly get this right, unless the file is very small. The heuristic is configurable, also, and the default for the "effort" parameter (don't remember what it's actually called) is too small in my opinion. I always jack it up way, way higher.

AFAICT the git developers will refuse addition of an explicit rename on the grounds that it's an "information tracker" and in theory it could also highlight code moved around in other ways. On the other hand the most recent release will also figure out that an entire directory was renamed, so if you add a file into that directory on one branch and rename the directory on another, when you merge these branches the newly added file will also be moved along with the rest of the files in that directory. It used to drive me nuts when I did merges like this in the past :)


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds