On 11/20/2015 03:10 PM, Stephan Beal wrote: > On Fri, Nov 20, 2015 at 8:55 PM, Eduard <eduard.c.dumitre...@gmail.com > <mailto:eduard.c.dumitre...@gmail.com>> wrote: > > On 11/20/2015 02:42 PM, Stephan Beal wrote: >> >> Is there a way of specifying the commit to which "fossil >> update" would >> update to? >> >> >> fossil update UUID-or-TAG > Sorry, I think I haven't been very clear. My question is rather, > is there an alias with the meaning "whatever commit 'fossil > update' would update to if I ran it right now"? > > > That alias is the name of the current branch (which you seem to want > to avoid, though i'm not sure why). I'm trying to avoid it because the two disagree if there are multiple independent branches that share the same name. Example:
$ f status repository: snip/fossil.fossil local-root: snip/ config-db: snip/.fossil checkout: f0de41fd5ed81cf91953e30fe5ca9e057aed2d34 2014-01-09 05:56:05 UTC parent: cbcd7056b6c3cba36c8cac8385d23517222116f3 2014-01-08 11:38:20 UTC child: d83fc58dead2d03428a763b0890b8b5fbffb7957 2014-01-09 13:17:23 UTC tags: pending-review comment: Attempts to add files outside the open checkout tree result in fatal error. (user: andybradford) $ f up -n UPDATE src/add.c ------------------------------------------------------------------------------- updated-to: d83fc58dead2d03428a763b0890b8b5fbffb7957 2014-01-09 13:17:23 UTC tags: pending-review comment: Add comments to better explain what it happening for the out-of-tree check in the "add" command. (user: drh) changes: 1 file modified. $ f up -n pending-review (snip) ------------------------------------------------------------------------------- updated-to: 2a1d7e0efc0f048b495815bac577d3c0f5c4d9a6 2015-10-20 08:14:11 UTC tags: pending-review comment: Docker build "release" by default. Meant for upcoming Fossil release. (user: jan.nijtmans) changes: 322 files modified. $ > fossil pull > > will sync any remote changes without applying them, then you can: > > fossil diff [--branch TAG] > > will show you changes against the tip of that branch (which is what > 'update' would update you to). I'm actually not exactly sure what that does. (The documentation isn't very clear about it.) But it's again not equivalent to what update would do in the above scenario: $ f diff --from current --to d83fc58dead2d03428a763b0890b8b5fbffb7957 | grep '+++' +++ src/add.c $ f diff --branch pending-review | grep '+++' +++ Dockerfile +++ src/info.c +++ src/timeline.c Again, I should have explained better. I want the diff between the current checkout (or even whatever commit the current checkout is based on) and what "fossil up" would update me to. The point is to have a quick glance at whatever everyone else did before updating (because maybe they introduced a really obvious bug, or maybe they inserted malicious code). This is the main reason why I don't use autosync; because then I would have to remember what the last commit I trust was, and then "fossil diff --from ${last_trusted_commit} --to current". > If, however, autosync is on, then there is a window of time where > 'diff' and 'update' may show different things because someone can > commit to the remote repo between your 'diff' and 'update'. > > > I could of course do this by parsing the output of "fossil update > --dry-run" and then running "fossil diff --from current --to > $UUID", but I'm wondering if there's a built-in way of doing it > without resorting to shell scripts. > > > 'update' will always take the tip unless told otherwise, which seems > to me to be what you want to diff against? If you'll disable autosync > (which isn't generally recommended) you can avoid any sort of race > condition between diff and update, and then simply rely on the > 'default to tip' behaviour. It depends what you mean by "tip" (whether it's the latest commit with a certain tag, or whether it's the latest commit with a certain tag /that is a direct descendant of the current commit/). Best, Eduard
signature.asc
Description: OpenPGP digital signature
_______________________________________________ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users