Re: [PATCH 1/3] retain reflogs for deleted refs
On 20 Jul 2012, at 19:09, Jeff King wrote: On Fri, Jul 20, 2012 at 06:37:02PM +0200, Johannes Sixt wrote: Am 20.07.2012 17:44, schrieb Jeff King: So I think a suffix like :d is probably the least horrible. Not so. It does not work on Windows :-( in the expected way. Trying to open a file with a colon-separated suffix either opens a resource fork on NTFS or fails with invalid path. Bleh. It seems that we did too good a job in coming up with a list of disallowed ref characters; they really are things you don't want in your filenames at all. :) How about using '@' as an escape character ? -Alexey. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] retain reflogs for deleted refs
On 20 Jul 2012, at 17:44, Jeff King wrote: On Fri, Jul 20, 2012 at 11:49:07AM +0200, Michael Haggerty wrote: This patch moves reflog entries into a special graveyard namespace, and appends a tilde (~) character, which is not allowed in a valid ref name. This means that the deleted reflogs of these refs: refs/heads/a refs/heads/a/b refs/heads/a/b/c will be stored in: logs/graveyard/refs/heads/a~ logs/graveyard/refs/heads/a/b~ logs/graveyard/refs/heads/a/b/c~ Putting them in the graveyard namespace ensures they will not conflict with live refs, and the tilde prevents D/F conflicts within the graveyard namespace. Sorry if this idea is stupid or if i miss something, but how about putting deleted reflogs for refs/heads/a refs/heads/a/b refs/heads/a/b/c to refs/heads/a@-mm-dd-hhmmss refs/heads/a/b@-mm-dd-hhmmss refs/heads/a/b/c@-mm-dd-hhmmss with the time they were deleted? -Alexey. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] retain reflogs for deleted refs
On Sun, Jul 22, 2012 at 01:10:55PM +0200, Alexey Muranov wrote: refs/heads/a refs/heads/a/b refs/heads/a/b/c will be stored in: logs/graveyard/refs/heads/a~ logs/graveyard/refs/heads/a/b~ logs/graveyard/refs/heads/a/b/c~ Putting them in the graveyard namespace ensures they will not conflict with live refs, and the tilde prevents D/F conflicts within the graveyard namespace. Sorry if this idea is stupid or if i miss something, but how about putting deleted reflogs for refs/heads/a refs/heads/a/b refs/heads/a/b/c to refs/heads/a@-mm-dd-hhmmss refs/heads/a/b@-mm-dd-hhmmss refs/heads/a/b/c@-mm-dd-hhmmss with the time they were deleted? I like the readability of the resulting file names, but it has three problems: 1. @ is allowed in ref names, so you may be conflicting with existing refs. You could fix that by using @{...}, which is disallowed. E.g., refs/heads/a@{-mm-dd-hhmmss}. 2. It makes lookup slightly more expensive, because to find a reflog for refs/heads/a, I have to scan logs/refs/heads looking for any matching entries of the form a@{.*}. This is probably not a huge deal in practice, though it does make the code more complex. 3. Most importantly, it does not resolve D/F conflicts (it has the same problem as logs/refs/heads/a~). If you delete foo/bar, you will end up with logs/refs/heads/foo/bar@{...}. That will prevent D/F conflicts with a new branch foo/bar/baz, but will still have a problem with just foo. You need to either mark each directory to avoid the conflict (Michael suggested something like refs/heads~/foo~/bar), or you need to put the deleted logs into a separate hierarchy (I used logs/graveyard in my patch). -Peff -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Unifying mergetool configuration between git and git-gui
Hi, I was about to add a configuration for yet another mergetool when I realized that git gui's mergetool.tcl pretty much duplicates git's mergetools/* configuration files. Can some one tell me why this is necessary? I would have expected git gui to simply rely on git mergetool to launch the mergetool. Or, in case that git gui needs to use a different tool than the one configured as mergetool, that mergetool.tcl somehow uses the configuration from mergetools/*. Thanks for any insights. -- Sebastian Schuberth -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] retain reflogs for deleted refs
On 22 Jul 2012, at 15:14, Jeff King wrote: 3. Most importantly, it does not resolve D/F conflicts (it has the same problem as logs/refs/heads/a~). If you delete foo/bar, you will end up with logs/refs/heads/foo/bar@{...}. That will prevent D/F conflicts with a new branch foo/bar/baz, but will still have a problem with just foo. Unfortunately i do not really follow this, because i have not seen any directories in logs/refs/heads/, i only saw files named after local branches there. I do not know how directories are used there. -Alexey.-- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Solve git-submodule issues with detached work trees
A common way to track dotfiles with git is using GIT_DIR and GIT_WORK_TREE to move repository out of ~/.git with something like: git init --bare ~/.dotfiles alias dotfiles=GIT_DIR=~/.dotfiles GIT_WORK_TREE=~ git dotfiles add ~/.bashrc dotfiles commit -a -m add my bashrc ... but git-submodule complains when trying to add submodules: dotfiles submodule add http://path.to/submodule fatal: working tree '/home/user' already exists. git --git-dir ~/.dotfiles submodule add http://path.to/submodule fatal: /usr/lib/git-core/git-submodule cannot be used without a working tree. Signed-off-by: Daniel Graña dan...@gmail.com --- git-submodule.sh |7 +++- t/t7409-submodule-detached-worktree.sh | 61 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100755 t/t7409-submodule-detached-worktree.sh diff --git a/git-submodule.sh b/git-submodule.sh index 5629d87..88ee4ea 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -181,8 +181,11 @@ module_clone() rm -f $gitdir/index else mkdir -p $gitdir_base - git clone $quiet -n ${reference:+$reference} \ - --separate-git-dir $gitdir $url $sm_path || + ( + clear_local_git_env + git clone $quiet -n ${reference:+$reference} \ + --separate-git-dir $gitdir $url $sm_path + ) || die $(eval_gettext Clone of '\$url' into submodule path '\$sm_path' failed) fi diff --git a/t/t7409-submodule-detached-worktree.sh b/t/t7409-submodule-detached-worktree.sh new file mode 100755 index 000..db75642 --- /dev/null +++ b/t/t7409-submodule-detached-worktree.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Copyright (c) 2012 Daniel Graña +# + +test_description='Test submodules on detached working tree + +This test verifies that git submodule initialization, update and addition works +on detahced working trees +' + +TEST_NO_CREATE_REPO=1 +. ./test-lib.sh + +test_expect_success 'submodule on detached working tree' ' + git init --bare remote + test_create_repo bundle1 + (cd bundle1 test_commit shoot) + mkdir home + ( + cd home + export GIT_WORK_TREE=$(pwd) GIT_DIR=$(pwd)/.dotfiles + git clone --bare ../remote .dotfiles + git submodule add ../bundle1 .vim/bundle/sogood + test_commit sogood + git push origin master + ) + mkdir home2 + ( + cd home2 + export GIT_WORK_TREE=$(pwd) GIT_DIR=$(pwd)/.dotfiles + git clone --bare ../remote .dotfiles + git submodule update --init + ) +' + +test_expect_success 'submodule on detached working pointed by core.worktree' ' + mkdir home3 + ( + cd home3 + export GIT_DIR=$(pwd)/.dotfiles + git clone --bare ../remote $GIT_DIR + git config core.bare false + git config core.worktree .. + git submodule add ../bundle1 .vim/bundle/dupe + test_commit dupe + git push origin master + ) + ( + cd home + export GIT_DIR=$(pwd)/.dotfiles + git config core.bare false + git config core.worktree .. + git pull + git submodule update + git submodule status + test -d .vim/bundle/dupe + ) +' + +test_done -- 1.7.5.4 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GSoC] Designing a faster index format - Progress report week 13
A note on how JGit would work here. Java has none of the fields that constitute statcrc. I guess we would write zero here when creating new entries. Git could recognize that when checking status and simply assume clean unless mtime or st_size says otherwise. For existing entries JGit could either keep the old value (which is probably a lie since) or zero it. A modification to the spec would be that 0 == not set. -- robin -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] retain reflogs for deleted refs
On Sun, Jul 22, 2012 at 04:40:14PM +0200, Alexey Muranov wrote: 3. Most importantly, it does not resolve D/F conflicts (it has the same problem as logs/refs/heads/a~). If you delete foo/bar, you will end up with logs/refs/heads/foo/bar@{...}. That will prevent D/F conflicts with a new branch foo/bar/baz, but will still have a problem with just foo. Unfortunately i do not really follow this, because i have not seen any directories in logs/refs/heads/, i only saw files named after local branches there. I do not know how directories are used there. The user is free to have branch names with slashes, in which case they are represented in the filesystem as directories. Even without using slashes in your branch names, you already have subdirectories in refs/remotes. -Peff -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC/PATCH] Only call record_resolve_undo() when coming from add/rm
Thomas Rast tr...@student.ethz.ch writes: The REUC extension stores the stage 1/2/3 data of entries which were marked resolved by the user, to enable 'git checkout -m name' to restore the conflicted state later. Yes. When a file was deleted on one side of the merge and unmodified on the other, merge-recursive uses remove_file_from_cache() to remove it from the result index. This uses remove_index_entry_at(), which calls record_resolve_undo(). What is missing from here which confused me during my initial read of this patch is But such a removal is the natural resolution for the three-way merge. It is not a resolution by the end user, and should not be unresolved with 'checkout -m'. Recording REUC entry for such a path is wrong. Perhaps you thought it was so obvious that it can be left unsaid, but combined with the in fact _even_ useless below, I had to re-read it to find something that says why it was _wrong_, did not find any, and had to scratch my head. Such REUC entries are in fact even useless: neither 'git checkout -m' nor 'git update-index --unresolve' can resurrect the file (the former because there is no corresponding index entry, the latter because the file is missing one side). I do not think that they are not used the current implementation of the commands that are supposed to use the information automatically qualifies as a good reason to remove them. If the conflict were we modified while they removed, the resolution may either be keep some stuff we added or delete the path, we may want to be able to resurrect the conflicted state with checkout -m for them, and we may want to fix checkout -m and update-index --unresolve to deal with such a case if they don't already, which is an independent topic. For the one side untouched, the other side removed case, removing is the natural resolution, so we do not want to have REUC entry to begin with, so there is nothing to fix in checkout -m for that case. Solve this by taking a more specific approach to record_resolve_undo(): Just a sanity check. Are there cases we would want to have _any_ REUC entries in the index, after running any mergy operation, not just merge-recursive, but cherry-pick and friends that share the same machinery? * git-rm and 'git update-index --remove' go through remove_file_from_cache(), just like merge-recursive. Make them use a new _extended version that optionally records REUC. I wonder if it is better have two functions, one records REUC (and does nothing else) and the other that removes a path from the in-core index (and does nothing else), instead of two functions that both remove a path from the in-core index (one with REUC and the other without). Would it be less error-prone for the callers and make the resulting code easier to follow? if (path is conflicted and we are resolving as removal) record_REUC(the_index, path); remove_file_from_cache(the_index, path); Not a suggestion I think it is better, but just a question. * git-add and 'git update-index conflicted_file' go through the add_index_entry() call chain. git-apply and git-read-tree use add_index_entry() too. However, they insert stage-0 entries, which already means resolving. So even if these cases were not caught earlier, saving the unresolved state would be correct. So we can unconditionally record REUC deeper in the call chain. Are there cases where an automerge use add_index_entry() to insert a stage#0 entry to the index (which already means resolving) to record a clean automerge? Doesn't the same a natural three-way resolution should not be unresolved with 'checkout -m' reasoning as the original motivation of this patch apply to it? -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 2/7] i18n: rebase: mark strings for translation
Jiang Xin worldhello@gmail.com writes: -resolvemsg= +resolvemsg=$(gettext When you have resolved this problem run \git rebase --continue\. If you would prefer to skip this patch, instead run \git rebase --skip\. To check out the original branch and stop rebasing run \git rebase --abort\. - +) Two micronits: - A=B assignment can lose the outermost dq-pair around it (i.e. A=B), which might make the above easier to read. - The original message had to backslash-quote only because the outermost quote was done with a dq-pair, but it does not use any substitutions, so turning it into a sq-pair might make the above easier to read. With might, I am not saying the above should be _fixed_; I am merely saying we may want to consider these points to see if some changes to your patch are improvements. resolvemsg=$(gettext ' When you have resolved this problem run git rebase --continue. If you would prefer to skip this patch, instead run git rebase --skip. To check out the original branch and stop rebasing run git rebase --abort. ') @@ -316,12 +317,12 @@ test $# -gt 2 usage if test -n $cmd test $interactive_rebase != explicit then - die --exec option must be used with --interactive option + die $(gettext -- --exec option must be used with --interactive option) This is a related tangent, but have we resolved that issue with xgettext and --? Ahh, I see you did something in [3/7] ;-) Thanks. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 7/7] i18n: merge-recursive: mark strings for translation
Jiang Xin worldhello@gmail.com writes: @@ -249,14 +249,14 @@ struct tree *write_tree_from_memory(struct merge_options *o) if (unmerged_cache()) { int i; - fprintf(stderr, BUG: There are unmerged index entries:\n); + fprintf(stderr, _(BUG: There are unmerged index entries:\n)); Micronit. BUG: entries are only to help Git developers to locate the exact codepath that is buggy, and I think it is better left untranslated. + if (NULL == renamed) { Better written as if (!renamed). -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] teach sha1_name to look in graveyard reflogs
Jeff King p...@peff.net writes: But what _should_ it show for such an entry? There is no commit to show in the reflog walker, but it would still be nice to say BTW, there was a deletion even here. Obviously just skipping it and showing the next entry would be better than the current behavior of stopping the traversal, but I feel like there must be some better behavior. Like showing an entry that says Ref deleted here, which should be easy to do by creating a phoney commit object and inserting it to the queue the reflog walker uses, I would guess. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
GSOC remote-svn
Hi! Refering to Jonathan's concerns in Saturday night's IRC log: [22:59:34] jrnieder barrbrain, flyingflo: I'm worried about the remote helper project [23:00:05] jrnieder someone needs to review remote-svn.c to catch things like that refspec issue which should be straightforward to an experienced eye Let me explain the refspec issue: In the the exisiting code in contrib/svn-fe commits are always imported to refs/heads/master, that was hardcoded. So I thought that couldn't be it. I made the name of the branch to import variable, depending on the name of the remote. But my remote-helper didn't advertise the refspec capability, so transport- helper assumed it imports to refs/heads/master, which is the default import refspec. The subsequent update of references in store_updated_refs lead to wrong values after the fetch, which I considered a bug and tried to fix. In fact I didn't realize that the actual updating of references is not done by the remote-helper. I thought the remote-helper would have to evaluate the fetch refspec and tell fast-import the correct target branch. Furthermore I confused 'private namespace' with refs/remotes/remote's name/, which I considered somehow private too. After several mailing iterations, showing me that I was wrong, I found what the right point is, namely that the remote helper writes references to a really private dir in refs/remote name/, it doesn't touch anything else, and by advertising the 'refspec' capability, git-fetch knows where the private refs are and updates non-private references according to the fetch refspec in some post-processing in store_updated_refs. (Ok, you will say of course!, but I didn't know that I was wrong and it's hidden in some 1000 lines of code). For me that was not very easy to figure out, and it took a lot of time, but I think now remote-svn does it right. [23:00:38] jrnieder (also, remote-svn.c should be at the toplevel so it can be tested more easily with tests in t/ [23:01:10] jrnieder and it should not be named remote-svn, since we haven't pinned down details about the svn:: conversion yet. That's why Dmitry's was called git-remote-svn-alpha) Ok. Why is that important? I think if it's not called remote-svn git doesn't find it as a helper for the 'svn' protocol. Actually in my local git tree, I have a symlink in the toplevel (to simpify PATH). [23:01:45] jrnieder I'm happy to review patches but I don't have a lot of time for it, which has been a problem: [23:02:11] jrnieder * I think I wasn't cc-ed on earlier discussion so they seem to come out of the blue. That's fine, but [23:03:05] jrnieder * I really rely on patches that do one logical thing with a commit message describing the context and what the patch is trying to accomplish. That makes review way, way easier when it is happening. Probably I should stop sending proposals or incomplete stuff to the list/you. The current state may probably be viewed easier in my github repo. I think for creating patches that are acceptable I will need to squash and split a lot of my development commits after the code is somehow finished and no longer experimental. [23:04:42] jrnieder Also it seems very chaotic: there are basic things about remote-svn.c that need fixing, and then patches for other things are appearing on top of that. [23:04:49] jrnieder Help? [23:05:26] jrnieder thanks, and hope that helps About the current state: Tester: I wrote a small simulation script in python that mimics svnrdumps behaviour by replaying an existing svn dump file from a start rev up to an end rev to test incremental imports. I use it together with a little testrepo shell script. Will need to bring that into t/ later, after figuring out how the test framework works. As it's not finished it's not published. Incremental import: By reading the latest svn revision number from a note attached to the private master ref, it starts future imports from the next svn revision. That basically works well. It doesn't reuse mark files. What's the point of reusing them? Dmitry's svn- alpha did that. All I need to know is the revision to start from and the branch i want to add commits to, right? It now simply reads that from the note. This got stuck on another problem: Incremental update of the note tree doesn't work. fast-import refuses to update the notes tree: 'newsha1 doesn't contain oldsha1'. I don't yet know what's the reason for this. I'm digging into the internals of notes to find out why.. (no problem with the file tree). This state hasn't hit the list of course, as it's in no way useful nor complete. I often get caught in the traingle of those three processes (git transport- helper, fast-import, remote-svn) needing to understand a lot about the existing two to understand why things don't work and why they need to work like they do. -- Florian -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to
[PATCH] gitk: Use an external icon file on Windows
Git for Windows now ships with the new Git icon from git-scm.com. Use that icon file instead of the old procedurally drawn one. Signed-off-by: Sebastian Schuberth sschube...@gmail.com --- gitk-git/gitk | 49 ++--- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/gitk-git/gitk b/gitk-git/gitk index 59693c0..bf2492e 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -11664,7 +11664,6 @@ if { [info exists ::env(GITK_MSGSDIR)] } { set gitk_prefix [file dirname [file dirname [file normalize $argv0]]] set gitk_libdir [file join $gitk_prefix share gitk lib] set gitk_msgsdir [file join $gitk_libdir msgs] -unset gitk_prefix } ## Internationalization (i18n) through msgcat and gettext. See @@ -11821,28 +11820,32 @@ if {[expr {[exec git rev-parse --is-inside-work-tree] == true}]} { set worktree [exec git rev-parse --show-toplevel] setcoords makewindow -catch { -image create photo gitlogo -width 16 -height 16 - -image create photo gitlogominus -width 4 -height 2 -gitlogominus put #C0 -to 0 0 4 2 -gitlogo copy gitlogominus -to 1 5 -gitlogo copy gitlogominus -to 6 5 -gitlogo copy gitlogominus -to 11 5 -image delete gitlogominus - -image create photo gitlogoplus -width 4 -height 4 -gitlogoplus put #008000 -to 1 0 3 4 -gitlogoplus put #008000 -to 0 1 4 3 -gitlogo copy gitlogoplus -to 1 9 -gitlogo copy gitlogoplus -to 6 9 -gitlogo copy gitlogoplus -to 11 9 -image delete gitlogoplus - -image create photo gitlogo32-width 32 -height 32 -gitlogo32 copy gitlogo -zoom 2 2 - -wm iconphoto . -default gitlogo gitlogo32 +if {$::tcl_platform(platform) eq {windows}} { +wm iconbitmap . -default $gitk_prefix/etc/git.ico +} else { +catch { +image create photo gitlogo -width 16 -height 16 + +image create photo gitlogominus -width 4 -height 2 +gitlogominus put #C0 -to 0 0 4 2 +gitlogo copy gitlogominus -to 1 5 +gitlogo copy gitlogominus -to 6 5 +gitlogo copy gitlogominus -to 11 5 +image delete gitlogominus + +image create photo gitlogoplus -width 4 -height 4 +gitlogoplus put #008000 -to 1 0 3 4 +gitlogoplus put #008000 -to 0 1 4 3 +gitlogo copy gitlogoplus -to 1 9 +gitlogo copy gitlogoplus -to 6 9 +gitlogo copy gitlogoplus -to 11 9 +image delete gitlogoplus + +image create photo gitlogo32-width 32 -height 32 +gitlogo32 copy gitlogo -zoom 2 2 + +wm iconphoto . -default gitlogo gitlogo32 +} } # wait for the window to become visible tkwait visibility . -- 1.7.11.msysgit.2 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
What's cooking in git.git (Jul 2012, #06; Sun, 22)
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. I think we are more or less done for this cycle except for a handful of topics that are to be rerolled, even though I haven't tagged the tip of the 'master' with 1.7.12-rc0 yet. You can find the changes described here in the integration branches of the repositories listed at http://git-blame.blogspot.com/p/git-public-repositories.html -- [Graduated to master] * as/t4012-style-updates (2012-07-16) 8 commits (merged to 'next' on 2012-07-16 at 86c14f6) + t4012: Use test_must_fail instead of if-else + t4012: use 'printf' instead of 'dd' to generate a binary file + t4012: Re-indent test snippets + t4012: Make --shortstat test more robust + t4012: Break up pipe into serial redirections + t4012: Actually quote the sed script + t4012: Unquote git command fragment in test title + t4012: modernize style for quoting * jc/maint-filter-branch-epoch-date (2012-07-12) 3 commits (merged to 'next' on 2012-07-13 at d144342) + t7003: add test to filter a branch with a commit at epoch + date.c: Fix off by one error in object-header date parsing (merged to 'next' on 2012-07-10 at f9774ca) + filter-branch: do not forget the '@' prefix to force git-timestamp In 1.7.9 era, we taught git rebase about the raw timestamp format but we did not teach the same trick to filter-branch, which rolled a similar logic on its own. * jc/sha1-name-more (2012-07-13) 27 commits (merged to 'next' on 2012-07-13 at 534e6fe) + t1512: match the other object names (merged to 'next' on 2012-07-11 at d30ef51) + t1512: ignore whitespaces in wc -l output (merged to 'next' on 2012-07-10 at 669dd92) + rev-parse --disambiguate=prefix + rev-parse: A and B in rev-parse A..B refer to committish + reset: the command takes committish + commit-tree: the command wants a tree and commits + apply: --build-fake-ancestor expects blobs + sha1_name.c: add support for disambiguating other types + revision.c: the log family, except for show, takes committish + revision.c: allow handle_revision_arg() to take other flags + sha1_name.c: introduce get_sha1_committish() + sha1_name.c: teach lookup context to get_sha1_with_context() + sha1_name.c: many short names can only be committish + sha1_name.c: get_sha1_1() takes lookup flags + sha1_name.c: get_describe_name() by definition groks only commits + sha1_name.c: teach get_short_sha1() a commit-only option + sha1_name.c: allow get_short_sha1() to take other flags + get_sha1(): fix error status regression + sha1_name.c: restructure disambiguation of short names + sha1_name.c: correct misnamed canonical and res + sha1_name.c: refactor find_short_packed_object() + sha1_name.c: rename now to current + sha1_name.c: clarify what fake is for in find_short_object_filename() + sha1_name.c: get rid of get_sha1_with_mode() + sha1_name.c: get rid of get_sha1_with_mode_1() + sha1_name.c: hide get_sha1_with_context_1() ugliness + sha1_name.c: indentation fix Logic to disambiguate abbreviated object names have been taught to take advantage of object types that are expected in the context, e.g. XX in the git describe output v1.2.3-gXX must be a commit object, not a blob nor a tree. This will help us prolong the lifetime of abbreviated object names. * jk/revision-walk-stop-at-max-count (2012-07-13) 1 commit (merged to 'next' on 2012-07-16 at 603975d) + revision: avoid work after --max-count is reached git log -n 1 -- rarely-touched-path was spending unnecessary cycles after showing the first change to find the next one, only to discard it. * jl/maint-1.7.10-recurse-submodules-with-symlink (2012-07-12) 1 commit (merged to 'next' on 2012-07-16 at 2e10caf) + submodules: don't stumble over symbolic links when cloning recursively When git submodule add clones a submodule repository, it can get confused where to store the resulting submodule repository in the superproject's .git/ directory when there is a symbolic link in the path to the current directory. * lk/more-helpful-status-hints (2012-07-16) 1 commit (merged to 'next' on 2012-07-16 at 8f9b3cc) + status: color in-progress message like other header messages Finishing touches. * mm/config-xdg (2012-07-16) 1 commit (merged to 'next' on 2012-07-16 at 1a75d75) + config: fix several access(NULL) calls Finishing touches. * ms/daemon-doc-typo (2012-07-16) 1 commit (merged to 'next' on 2012-07-16 at 3976434) + Documentation/git-daemon: add missing word * pg/maint-1.7.9-am-where-is-patch (2012-07-13) 1 commit (merged to 'next' on 2012-07-16 at 32f1e30) + am: indicate where a failed patch is to be found When git am failed, old timers knew to check .git/rebase-apply/patch to see what went wrong, but we never told the users about it. -- [New Topics] *
Re: GSOC remote-svn
Hi, Florian Achleitner wrote: After several mailing iterations, showing me that I was wrong, I found what the right point is, namely that the remote helper writes references to a really private dir in refs/remote name/, it doesn't touch anything else, and by advertising the 'refspec' capability, git-fetch knows where the private refs are and updates non-private references according to the fetch refspec in some post-processing in store_updated_refs. Right, that's fine. And you did a fine job of navigating the existing documentation (which could be improved, hint hint). What I am more concerned about is that you had code you sent a while ago for review, that this would have been obvious to David, Ram, Dmitry, or me if we had seen it, and yet none of us gave you that help. We are failing at _our_ job of giving you prompt advice and instead you have had to work on your own. Isn't it likely that there are multiple other bugs like that which still haven't been fixed? That's why I think we need to get into a habit of giving and getting feedback quickly and incrementally improving work. Soon, before the summer ends. [...] [23:01:10] jrnieder and it should not be named remote-svn, since we haven't pinned down details about the svn:: conversion yet. That's why Dmitry's was called git-remote-svn-alpha) Ok. Why is that important? I think if it's not called remote-svn git doesn't fid it as a helper for the 'svn' protocol. It finds it as a helper for the 'svn-alpha' protocol instead. The point is that when I perform the following steps: git clone svn://path/to/remote/repo ... wait a day, update git cd repo git pull nobody would expect the result to be a non-fast-forward update caused by the details of svn-to-git conversion changing. Using a name like testsvn or svn-alpha would help in managing expectations --- the remote helper is meant for experimentation for now and not meant to be something people can rely on for collaboration. [...] [23:03:05] jrnieder * I really rely on patches that do one logical thing with a commit message describing the context and what the patch is trying to accomplish. That makes review way, way easier when it is happening. Probably I should stop sending proposals or incomplete stuff to the list/you. The current state may probably be viewed easier in my github repo. No, incomplete stuff is nice. Just please do explain the _purpose_ of the code you are sending out. The best possible outcome is if someone realizes that something that would have taken hours doesn't need to be done at all. [...] I wrote a small simulation script in python that mimics svnrdumps behaviour by replaying an existing svn dump file from a start rev up to an end rev to test incremental imports. I use it together with a little testrepo shell script. Will need to bring that into t/ later, after figuring out how the test framework works. As it's not finished it's not published. Sounds neat --- how can one try it out? Incremental import: By reading the latest svn revision number from a note attached to the private master ref, it starts future imports from the next svn revision. That basically works well. It doesn't reuse mark files. What's the point of reusing them? Dmitry's svn- alpha did that. All I need to know is the revision to start from and the branch i want to add commits to, right? It now simply reads that from the note. The marks are used to handle copyfrom operations referring to older revisions. Are you sure you want to abandon them? Can you explain a little more about your plan? [...] This state hasn't hit the list of course, as it's in no way useful nor complete. A good habit to get into is to make sure your partial progress toward a goal is in a usable state periodically, even if it is not complete. That makes it a lot easier to test and to get other people to look it over. A rule of thumb is that unless you are adding a new and complicated feature, it should be possible to fit each change in a patch of around 250 lines including context (not including documentation and tests). I often get caught in the traingle of those three processes (git transport- helper, fast-import, remote-svn) needing to understand a lot about the existing two to understand why things don't work and why they need to work like they do. Probably you are finding documentation bugs right and left (yes, information not being easy to find is a bug) that don't get fixed because no one has reported them. Questions are welcome and very useful. Hope that helps, Jonathan -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/2] block-sha1: avoid pointer conversion that violates alignment constraints
With 660231aa (block-sha1: support for architectures with memory alignment restrictions, 2009-08-12), blk_SHA1_Update was modified to access 32-bit chunks of memory one byte at a time on arches that prefer that: #define get_be32(p)( \ (*((unsigned char *)(p) + 0) 24) | \ (*((unsigned char *)(p) + 1) 16) | \ (*((unsigned char *)(p) + 2) 8) | \ (*((unsigned char *)(p) + 3) 0) ) The code previously accessed these values by just using htonl(*p). Unfortunately, Michael noticed on an Alpha machine that git was using plain 32-bit reads anyway. As soon as we convert a pointer to int *, the compiler can assume that the object pointed to is correctly aligned as an int (C99 section 6.3.2.3 pointer conversions paragraph 7), and gcc takes full advantage by using a single 32-bit load, resulting in a whole bunch of unaligned access traps. So we need to obey the alignment constraints even when only dealing with pointers instead of actual values. Do so by changing the type of 'data' to void *. This patch renames 'data' to 'block' at the same time to make sure all references are updated to reflect the new type. Reported-tested-and-explained-by: Michael Cree mc...@orcon.net.nz Signed-off-by: Jonathan Nieder jrnie...@gmail.com Acked-by: Linus Torvalds torva...@linux-foundation.org --- Changes since v2: - fixed explanation of how the alignment assumption shows up in the assembler[1] - add Linus's ack [1] http://thread.gmane.org/gmane.comp.version-control.git/201434/focus=201484 block-sha1/sha1.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c index d8934757..10fd94d1 100644 --- a/block-sha1/sha1.c +++ b/block-sha1/sha1.c @@ -100,7 +100,7 @@ * Where do we get the source from? The first 16 iterations get it from * the input data, the next mix it from the 512-bit array. */ -#define SHA_SRC(t) get_be32(data + t) +#define SHA_SRC(t) get_be32((unsigned char *) block + t*4) #define SHA_MIX(t) SHA_ROL(W(t+13) ^ W(t+8) ^ W(t+2) ^ W(t), 1) #define SHA_ROUND(t, input, fn, constant, A, B, C, D, E) do { \ @@ -114,7 +114,7 @@ #define T_40_59(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, ((BC)+(D(B^C))) , 0x8f1bbcdc, A, B, C, D, E ) #define T_60_79(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) , 0xca62c1d6, A, B, C, D, E ) -static void blk_SHA1_Block(blk_SHA_CTX *ctx, const unsigned int *data) +static void blk_SHA1_Block(blk_SHA_CTX *ctx, const void *block) { unsigned int A,B,C,D,E; unsigned int array[16]; @@ -125,7 +125,7 @@ static void blk_SHA1_Block(blk_SHA_CTX *ctx, const unsigned int *data) D = ctx-H[3]; E = ctx-H[4]; - /* Round 1 - iterations 0-16 take their input from 'data' */ + /* Round 1 - iterations 0-16 take their input from 'block' */ T_0_15( 0, A, B, C, D, E); T_0_15( 1, E, A, B, C, D); T_0_15( 2, D, E, A, B, C); -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] block-sha1: put expanded macro parameters in parentheses
't' is currently always a numeric constant, but it can't hurt to prepare for the day that it becomes useful for a caller to pass in a more complex expression. Suggested-by: Linus Torvalds torva...@linux-foundation.org Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Clarified subject line. No other change. Thanks for reading. block-sha1/sha1.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c index 10fd94d1..6f885c43 100644 --- a/block-sha1/sha1.c +++ b/block-sha1/sha1.c @@ -100,8 +100,8 @@ * Where do we get the source from? The first 16 iterations get it from * the input data, the next mix it from the 512-bit array. */ -#define SHA_SRC(t) get_be32((unsigned char *) block + t*4) -#define SHA_MIX(t) SHA_ROL(W(t+13) ^ W(t+8) ^ W(t+2) ^ W(t), 1) +#define SHA_SRC(t) get_be32((unsigned char *) block + (t)*4) +#define SHA_MIX(t) SHA_ROL(W((t)+13) ^ W((t)+8) ^ W((t)+2) ^ W(t), 1); #define SHA_ROUND(t, input, fn, constant, A, B, C, D, E) do { \ unsigned int TEMP = input(t); setW(t, TEMP); \ -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Makefile: fix location of listing produced by make subdir/foo.s
When I invoke make block-sha1/sha1.s, 'make' runs $(CC) -S without specifying where it should put its output and the output ends up in ./sha1.s. Confusing. Add an -o option to the .s rule to fix this. We were already doing that for most compiler invocations but had forgotten it for the assembler listings. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Hi, This patch is from below the scissors at http://thread.gmane.org/gmane.comp.version-control.git/201434/focus=201485 I think it's a good change, but as usual it's nice if someone else takes a look at it and gives it a sanity check. If it seems sane, I'd be happy to see it applied. What do you think? Thanks, Jonathan Makefile |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 285c660e..8bfa19cd 100644 --- a/Makefile +++ b/Makefile @@ -2263,7 +2263,7 @@ $(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs) endif %.s: %.c GIT-CFLAGS FORCE - $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $ + $(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $ ifdef USE_COMPUTED_HEADER_DEPENDENCIES # Take advantage of gcc's on-the-fly dependency generation -- 1.7.10.4 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Unifying mergetool configuration between git and git-gui
On Sun, Jul 22, 2012 at 7:22 AM, Sebastian Schuberth sschube...@gmail.com wrote: Hi, I was about to add a configuration for yet another mergetool when I realized that git gui's mergetool.tcl pretty much duplicates git's mergetools/* configuration files. Can some one tell me why this is necessary? I would have expected git gui to simply rely on git mergetool to launch the mergetool. Or, in case that git gui needs to use a different tool than the one configured as mergetool, that mergetool.tcl somehow uses the configuration from mergetools/*. Thanks for any insights. I think the mergetool stuff in git-gui predates git-mergetool. Ditto the external diff stuff in gitk -- it predates git-difftool. It would be good to unify these so that the difftool/mergetool experience is consistent. As for how to have different diff/merge tools in GUI vs non-GUI modes -- we have 'diff.guitool' to override 'diff.tool' when git difftool --gui is used. We do not have an equivalent 'merge.guitool', but that would probably be the way to do it. -- David -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 0/7] i18n for git-am, git-rebase and git-merge
2012/7/23 Junio C Hamano gits...@pobox.com: I do not understand why many of these have Stefano's S-o-b in them. If you are relaying what Stefano originally wrote, then the author (i.e. From: ) and the first S-o-b would say Stefano, and your S-o-b will follow it, but that is probably not the case. I'll drop the S-o-b lines for now. It is because Stefano offers lots of help for correcting syntax errors and misspellings in the original commit logs. Should I use Reviewed-by tag instead of S-o-b? And in PATCH 3/7, there is a Ævar's S-o-b, it is because the workaround comes from Ævar's idea. Is this tag suitable? I think I should add a Reported-by tag for Vincent, as he report it first in this mail: http://thread.gmane.org/gmane.comp.version-control.git/199042 By the way, is there any existing test that needs to gain GETTEXT_POISON or test_i18ncmp with this change? I find one test case failed, and correct it in PATCH 3/7. -- Jiang Xin -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/5] difftool: Eliminate global variables
Organize the script so that it has a single main() function which calls out to dir_diff() and file_diff() functions. This eliminates dir-diff-specific variables that do not need to be calculated when performing a regular file-diff. Signed-off-by: David Aguilar dav...@gmail.com --- git-difftool.perl | 128 -- 1 file changed, 75 insertions(+), 53 deletions(-) diff --git a/git-difftool.perl b/git-difftool.perl index ac0ed63..41ba932 100755 --- a/git-difftool.perl +++ b/git-difftool.perl @@ -22,11 +22,6 @@ use File::Temp qw(tempdir); use Getopt::Long qw(:config pass_through); use Git; -my @working_tree; -my $rc; -my $repo = Git-repository(); -my $repo_path = $repo-repo_path(); - sub usage { my $exitcode = shift; @@ -43,6 +38,8 @@ USAGE sub find_worktree { + my ($repo) = @_; + # Git-repository-wc_path() does not honor changes to the working # tree location made by $ENV{GIT_WORK_TREE} or the 'core.worktree' # config variable. @@ -61,8 +58,6 @@ sub find_worktree return $worktree; } -my $workdir = find_worktree(); - sub print_tool_help { my ($cmd, @found, @notfound); @@ -97,10 +92,13 @@ sub print_tool_help sub setup_dir_diff { + my ($repo, $workdir) = @_; + # Run the diff; exit immediately if no diff found # 'Repository' and 'WorkingCopy' must be explicitly set to insure that # if $GIT_DIR and $GIT_WORK_TREE are set in ENV, they are actually used # by Git-repository-command*. + my $repo_path = $repo-repo_path(); my $diffrepo = Git-repository(Repository = $repo_path, WorkingCopy = $workdir); my $diffrtn = $diffrepo-command_oneline('diff', '--raw', '--no-abbrev', '-z', @ARGV); exit(0) if (length($diffrtn) == 0); @@ -121,6 +119,7 @@ sub setup_dir_diff my $rindex = ''; my %submodule; my %symlink; + my @working_tree = (); my @rawdiff = split('\0', $diffrtn); my $i = 0; @@ -188,7 +187,7 @@ sub setup_dir_diff ($inpipe, $ctx) = $repo-command_input_pipe(qw/update-index -z --index-info/); print($inpipe $lindex); $repo-command_close_pipe($inpipe, $ctx); - $rc = system('git', 'checkout-index', '--all', --prefix=$ldir/); + my $rc = system('git', 'checkout-index', '--all', --prefix=$ldir/); exit($rc | ($rc 8)) if ($rc != 0); $ENV{GIT_INDEX_FILE} = $tmpdir/rindex; @@ -238,7 +237,7 @@ sub setup_dir_diff } } - return ($ldir, $rdir); + return ($ldir, $rdir, @working_tree); } sub write_to_file @@ -261,54 +260,70 @@ sub write_to_file close($fh); } -# parse command-line options. all unrecognized options and arguments -# are passed through to the 'git diff' command. -my ($difftool_cmd, $dirdiff, $extcmd, $gui, $help, $prompt, $tool_help); -GetOptions('g|gui!' = \$gui, - 'd|dir-diff' = \$dirdiff, - 'h' = \$help, - 'prompt!' = \$prompt, - 'y' = sub { $prompt = 0; }, - 't|tool:s' = \$difftool_cmd, - 'tool-help' = \$tool_help, - 'x|extcmd:s' = \$extcmd); - -if (defined($help)) { - usage(0); -} -if (defined($tool_help)) { - print_tool_help(); -} -if (defined($difftool_cmd)) { - if (length($difftool_cmd) 0) { - $ENV{GIT_DIFF_TOOL} = $difftool_cmd; - } else { - print No tool given for --tool=tool\n; - usage(1); +sub main +{ + # parse command-line options. all unrecognized options and arguments + # are passed through to the 'git diff' command. + my ($difftool_cmd, $dirdiff, $extcmd, $gui, $help, $prompt, $tool_help); + GetOptions('g|gui!' = \$gui, + 'd|dir-diff' = \$dirdiff, + 'h' = \$help, + 'prompt!' = \$prompt, + 'y' = sub { $prompt = 0; }, + 't|tool:s' = \$difftool_cmd, + 'tool-help' = \$tool_help, + 'x|extcmd:s' = \$extcmd); + + if (defined($help)) { + usage(0); } -} -if (defined($extcmd)) { - if (length($extcmd) 0) { - $ENV{GIT_DIFFTOOL_EXTCMD} = $extcmd; - } else { - print No cmd given for --extcmd=cmd\n; - usage(1); + if (defined($tool_help)) { + print_tool_help(); } -} -if ($gui) { - my $guitool = ''; - $guitool = Git::config('diff.guitool'); - if (length($guitool) 0) { - $ENV{GIT_DIFF_TOOL} = $guitool; + if (defined($difftool_cmd)) { + if (length($difftool_cmd) 0) { + $ENV{GIT_DIFF_TOOL} = $difftool_cmd; + } else { + print No tool given for --tool=tool\n; + usage(1); + } + } + if (defined($extcmd)) { + if (length($extcmd) 0) { + $ENV{GIT_DIFFTOOL_EXTCMD} =
[PATCH 5/5] difftool: Use symlinks when diffing against the worktree
Teach difftool's --dir-diff mode to use symlinks to represent files from the working copy, and make it the default behavior for the non-Windows platforms. Using symlinks is simpler and safer since we do not need to worry about copying files back into the worktree. The old behavior is still available as --no-symlinks. Signed-off-by: David Aguilar dav...@gmail.com --- Documentation/git-difftool.txt | 8 git-difftool.perl | 30 +++--- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt index 31fc2e3..313d54e 100644 --- a/Documentation/git-difftool.txt +++ b/Documentation/git-difftool.txt @@ -66,6 +66,14 @@ of the diff post-image. `$MERGED` is the name of the file which is being compared. `$BASE` is provided for compatibility with custom merge tool commands and has the same value as `$MERGED`. +--symlinks:: +--no-symlinks:: + 'git difftool''s default behavior is create symlinks to the + working tree when run in `--dir-diff` mode. ++ + Specifying `--no-symlinks` instructs 'git difftool' to create + copies instead. `--no-symlinks` is the default on Windows. + --tool-help:: Print a list of diff tools that may be used with `--tool`. diff --git a/git-difftool.perl b/git-difftool.perl index 2ae344c..b8f8057 100755 --- a/git-difftool.perl +++ b/git-difftool.perl @@ -92,7 +92,7 @@ sub print_tool_help sub setup_dir_diff { - my ($repo, $workdir) = @_; + my ($repo, $workdir, $symlinks) = @_; # Run the diff; exit immediately if no diff found # 'Repository' and 'WorkingCopy' must be explicitly set to insure that @@ -209,8 +209,13 @@ sub setup_dir_diff unless (-d $rdir/$dir) { mkpath($rdir/$dir) or die $!; } - copy($workdir/$file, $rdir/$file) or die $!; - chmod(stat($workdir/$file)-mode, $rdir/$file) or die $!; + if ($symlinks) { + symlink($workdir/$file, $rdir/$file) or die $!; + } else { + copy($workdir/$file, $rdir/$file) or die $!; + my $mode = stat($workdir/$file)-mode; + chmod($mode, $rdir/$file) or die $!; + } } # Changes to submodules require special treatment. This loop writes a @@ -271,6 +276,7 @@ sub main gui = undef, help = undef, prompt = undef, + symlinks = $^O ne 'MSWin32' $^O ne 'msys', tool_help = undef, ); GetOptions('g|gui!' = \$opts{gui}, @@ -278,6 +284,8 @@ sub main 'h' = \$opts{help}, 'prompt!' = \$opts{prompt}, 'y' = sub { $opts{prompt} = 0; }, + 'symlinks' = \$opts{symlinks}, + 'no-symlinks' = sub { $opts{symlinks} = 0; }, 't|tool:s' = \$opts{difftool_cmd}, 'tool-help' = \$opts{tool_help}, 'x|extcmd:s' = \$opts{extcmd}); @@ -316,7 +324,7 @@ sub main # will invoke a separate instance of 'git-difftool--helper' for # each file that changed. if (defined($opts{dirdiff})) { - dir_diff($opts{extcmd}); + dir_diff($opts{extcmd}, $opts{symlinks}); } else { file_diff($opts{prompt}); } @@ -324,13 +332,13 @@ sub main sub dir_diff { - my ($extcmd) = @_; + my ($extcmd, $symlinks) = @_; my $rc; my $repo = Git-repository(); my $workdir = find_worktree($repo); - my ($a, $b, @working_tree) = setup_dir_diff($repo, $workdir); + my ($a, $b, @working_tree) = setup_dir_diff($repo, $workdir, $symlinks); if (defined($extcmd)) { $rc = system($extcmd, $a, $b); } else { @@ -340,15 +348,23 @@ sub dir_diff exit($rc | ($rc 8)) if ($rc != 0); + # Do not copy back files when symlinks are used + if ($symlinks) { + exit(0); + } + # If the diff including working copy files and those # files were modified during the diff, then the changes # should be copied back to the working tree + for my $file (@working_tree) { if (-e $b/$file compare($b/$file, $workdir/$file)) { copy($b/$file, $workdir/$file) or die $!; - chmod(stat($b/$file)-mode, $workdir/$file) or die $!; + my $mode = stat($b/$file)-mode; + chmod($mode, $workdir/$file) or die $!; } } + exit(0); } sub file_diff -- 1.7.11.2.255.g5f133da -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/5] difftool: Move option values into a hash
On Sun, Jul 22, 2012 at 8:42 PM, David Aguilar dav...@gmail.com wrote: ... This makes also gives us a place to specify default values Oops, please drop the word makes from the commit message here if you apply this, or I'll fix it in a re-roll if review finds other issues. Thanks, -- David -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 0/5] difftool: Use symlinks in dir-diff mode
Teach the difftool script to use symlinks when doing directory diffs in --dir-diff mode. This is v2 of the patch because I had a typo in one of the commit messages and gmail ate 4/5 in the last round. David Aguilar (5): difftool: Simplify print_tool_help() difftool: Eliminate global variables difftool: Move option values into a hash difftool: Call the temp directory git-difftool difftool: Use symlinks when diffing against the worktree Documentation/git-difftool.txt | 8 ++ git-difftool.perl | 184 - 2 files changed, 115 insertions(+), 77 deletions(-) -- 1.7.11.2.255.g5f133da -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 1/5] difftool: Simplify print_tool_help()
Eliminate a global variable and File::Find usage by building upon basename() and glob() instead. Signed-off-by: David Aguilar dav...@gmail.com --- Same as before, resending because gmail ate patch 4/5 git-difftool.perl | 25 + 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/git-difftool.perl b/git-difftool.perl index c079854..ac0ed63 100755 --- a/git-difftool.perl +++ b/git-difftool.perl @@ -13,17 +13,15 @@ use 5.008; use strict; use warnings; -use File::Basename qw(dirname); +use File::Basename qw(basename dirname); use File::Copy; use File::Compare; -use File::Find; use File::stat; use File::Path qw(mkpath); use File::Temp qw(tempdir); use Getopt::Long qw(:config pass_through); use Git; -my @tools; my @working_tree; my $rc; my $repo = Git-repository(); @@ -65,26 +63,13 @@ sub find_worktree my $workdir = find_worktree(); -sub filter_tool_scripts -{ - if (-d $_) { - if ($_ ne .) { - # Ignore files in subdirectories - $File::Find::prune = 1; - } - } else { - if ((-f $_) ($_ ne defaults)) { - push(@tools, $_); - } - } -} - sub print_tool_help { my ($cmd, @found, @notfound); my $gitpath = Git::exec_path(); - find(\filter_tool_scripts, $gitpath/mergetools); + my @files = map { basename($_) } glob($gitpath/mergetools/*); + my @tools = sort(grep { !m{^defaults$} } @files); foreach my $tool (@tools) { $cmd = TOOL_MODE=diff; @@ -99,10 +84,10 @@ sub print_tool_help } print 'git difftool --tool=tool' may be set to one of the following:\n; - print \t$_\n for (sort(@found)); + print \t$_\n for (@found); print \nThe following tools are valid, but not currently available:\n; - print \t$_\n for (sort(@notfound)); + print \t$_\n for (@notfound); print \nNOTE: Some of the tools listed above only work in a windowed\n; print environment. If run in a terminal-only session, they will fail.\n; -- 1.7.11.2.255.g5f133da -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/5] difftool: Eliminate global variables
Organize the script so that it has a single main() function which calls out to dir_diff() and file_diff() functions. This eliminates dir-diff-specific variables that do not need to be calculated when performing a regular file-diff. Signed-off-by: David Aguilar dav...@gmail.com --- Same as before, resending because gmail ate patch 4/5 git-difftool.perl | 128 -- 1 file changed, 75 insertions(+), 53 deletions(-) diff --git a/git-difftool.perl b/git-difftool.perl index ac0ed63..41ba932 100755 --- a/git-difftool.perl +++ b/git-difftool.perl @@ -22,11 +22,6 @@ use File::Temp qw(tempdir); use Getopt::Long qw(:config pass_through); use Git; -my @working_tree; -my $rc; -my $repo = Git-repository(); -my $repo_path = $repo-repo_path(); - sub usage { my $exitcode = shift; @@ -43,6 +38,8 @@ USAGE sub find_worktree { + my ($repo) = @_; + # Git-repository-wc_path() does not honor changes to the working # tree location made by $ENV{GIT_WORK_TREE} or the 'core.worktree' # config variable. @@ -61,8 +58,6 @@ sub find_worktree return $worktree; } -my $workdir = find_worktree(); - sub print_tool_help { my ($cmd, @found, @notfound); @@ -97,10 +92,13 @@ sub print_tool_help sub setup_dir_diff { + my ($repo, $workdir) = @_; + # Run the diff; exit immediately if no diff found # 'Repository' and 'WorkingCopy' must be explicitly set to insure that # if $GIT_DIR and $GIT_WORK_TREE are set in ENV, they are actually used # by Git-repository-command*. + my $repo_path = $repo-repo_path(); my $diffrepo = Git-repository(Repository = $repo_path, WorkingCopy = $workdir); my $diffrtn = $diffrepo-command_oneline('diff', '--raw', '--no-abbrev', '-z', @ARGV); exit(0) if (length($diffrtn) == 0); @@ -121,6 +119,7 @@ sub setup_dir_diff my $rindex = ''; my %submodule; my %symlink; + my @working_tree = (); my @rawdiff = split('\0', $diffrtn); my $i = 0; @@ -188,7 +187,7 @@ sub setup_dir_diff ($inpipe, $ctx) = $repo-command_input_pipe(qw/update-index -z --index-info/); print($inpipe $lindex); $repo-command_close_pipe($inpipe, $ctx); - $rc = system('git', 'checkout-index', '--all', --prefix=$ldir/); + my $rc = system('git', 'checkout-index', '--all', --prefix=$ldir/); exit($rc | ($rc 8)) if ($rc != 0); $ENV{GIT_INDEX_FILE} = $tmpdir/rindex; @@ -238,7 +237,7 @@ sub setup_dir_diff } } - return ($ldir, $rdir); + return ($ldir, $rdir, @working_tree); } sub write_to_file @@ -261,54 +260,70 @@ sub write_to_file close($fh); } -# parse command-line options. all unrecognized options and arguments -# are passed through to the 'git diff' command. -my ($difftool_cmd, $dirdiff, $extcmd, $gui, $help, $prompt, $tool_help); -GetOptions('g|gui!' = \$gui, - 'd|dir-diff' = \$dirdiff, - 'h' = \$help, - 'prompt!' = \$prompt, - 'y' = sub { $prompt = 0; }, - 't|tool:s' = \$difftool_cmd, - 'tool-help' = \$tool_help, - 'x|extcmd:s' = \$extcmd); - -if (defined($help)) { - usage(0); -} -if (defined($tool_help)) { - print_tool_help(); -} -if (defined($difftool_cmd)) { - if (length($difftool_cmd) 0) { - $ENV{GIT_DIFF_TOOL} = $difftool_cmd; - } else { - print No tool given for --tool=tool\n; - usage(1); +sub main +{ + # parse command-line options. all unrecognized options and arguments + # are passed through to the 'git diff' command. + my ($difftool_cmd, $dirdiff, $extcmd, $gui, $help, $prompt, $tool_help); + GetOptions('g|gui!' = \$gui, + 'd|dir-diff' = \$dirdiff, + 'h' = \$help, + 'prompt!' = \$prompt, + 'y' = sub { $prompt = 0; }, + 't|tool:s' = \$difftool_cmd, + 'tool-help' = \$tool_help, + 'x|extcmd:s' = \$extcmd); + + if (defined($help)) { + usage(0); } -} -if (defined($extcmd)) { - if (length($extcmd) 0) { - $ENV{GIT_DIFFTOOL_EXTCMD} = $extcmd; - } else { - print No cmd given for --extcmd=cmd\n; - usage(1); + if (defined($tool_help)) { + print_tool_help(); } -} -if ($gui) { - my $guitool = ''; - $guitool = Git::config('diff.guitool'); - if (length($guitool) 0) { - $ENV{GIT_DIFF_TOOL} = $guitool; + if (defined($difftool_cmd)) { + if (length($difftool_cmd) 0) { + $ENV{GIT_DIFF_TOOL} = $difftool_cmd; + } else { + print No tool given for --tool=tool\n; + usage(1); + } + } + if (defined($extcmd)) { + if (length($extcmd)
[PATCH 5/5] difftool: Use symlinks when diffing against the worktree
Teach difftool's --dir-diff mode to use symlinks to represent files from the working copy, and make it the default behavior for the non-Windows platforms. Using symlinks is simpler and safer since we do not need to worry about copying files back into the worktree. The old behavior is still available as --no-symlinks. Signed-off-by: David Aguilar dav...@gmail.com --- Same as before, resending because gmail ate patch 4/5 Documentation/git-difftool.txt | 8 git-difftool.perl | 30 +++--- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt index 31fc2e3..313d54e 100644 --- a/Documentation/git-difftool.txt +++ b/Documentation/git-difftool.txt @@ -66,6 +66,14 @@ of the diff post-image. `$MERGED` is the name of the file which is being compared. `$BASE` is provided for compatibility with custom merge tool commands and has the same value as `$MERGED`. +--symlinks:: +--no-symlinks:: + 'git difftool''s default behavior is create symlinks to the + working tree when run in `--dir-diff` mode. ++ + Specifying `--no-symlinks` instructs 'git difftool' to create + copies instead. `--no-symlinks` is the default on Windows. + --tool-help:: Print a list of diff tools that may be used with `--tool`. diff --git a/git-difftool.perl b/git-difftool.perl index 2ae344c..b8f8057 100755 --- a/git-difftool.perl +++ b/git-difftool.perl @@ -92,7 +92,7 @@ sub print_tool_help sub setup_dir_diff { - my ($repo, $workdir) = @_; + my ($repo, $workdir, $symlinks) = @_; # Run the diff; exit immediately if no diff found # 'Repository' and 'WorkingCopy' must be explicitly set to insure that @@ -209,8 +209,13 @@ sub setup_dir_diff unless (-d $rdir/$dir) { mkpath($rdir/$dir) or die $!; } - copy($workdir/$file, $rdir/$file) or die $!; - chmod(stat($workdir/$file)-mode, $rdir/$file) or die $!; + if ($symlinks) { + symlink($workdir/$file, $rdir/$file) or die $!; + } else { + copy($workdir/$file, $rdir/$file) or die $!; + my $mode = stat($workdir/$file)-mode; + chmod($mode, $rdir/$file) or die $!; + } } # Changes to submodules require special treatment. This loop writes a @@ -271,6 +276,7 @@ sub main gui = undef, help = undef, prompt = undef, + symlinks = $^O ne 'MSWin32' $^O ne 'msys', tool_help = undef, ); GetOptions('g|gui!' = \$opts{gui}, @@ -278,6 +284,8 @@ sub main 'h' = \$opts{help}, 'prompt!' = \$opts{prompt}, 'y' = sub { $opts{prompt} = 0; }, + 'symlinks' = \$opts{symlinks}, + 'no-symlinks' = sub { $opts{symlinks} = 0; }, 't|tool:s' = \$opts{difftool_cmd}, 'tool-help' = \$opts{tool_help}, 'x|extcmd:s' = \$opts{extcmd}); @@ -316,7 +324,7 @@ sub main # will invoke a separate instance of 'git-difftool--helper' for # each file that changed. if (defined($opts{dirdiff})) { - dir_diff($opts{extcmd}); + dir_diff($opts{extcmd}, $opts{symlinks}); } else { file_diff($opts{prompt}); } @@ -324,13 +332,13 @@ sub main sub dir_diff { - my ($extcmd) = @_; + my ($extcmd, $symlinks) = @_; my $rc; my $repo = Git-repository(); my $workdir = find_worktree($repo); - my ($a, $b, @working_tree) = setup_dir_diff($repo, $workdir); + my ($a, $b, @working_tree) = setup_dir_diff($repo, $workdir, $symlinks); if (defined($extcmd)) { $rc = system($extcmd, $a, $b); } else { @@ -340,15 +348,23 @@ sub dir_diff exit($rc | ($rc 8)) if ($rc != 0); + # Do not copy back files when symlinks are used + if ($symlinks) { + exit(0); + } + # If the diff including working copy files and those # files were modified during the diff, then the changes # should be copied back to the working tree + for my $file (@working_tree) { if (-e $b/$file compare($b/$file, $workdir/$file)) { copy($b/$file, $workdir/$file) or die $!; - chmod(stat($b/$file)-mode, $workdir/$file) or die $!; + my $mode = stat($b/$file)-mode; + chmod($mode, $workdir/$file) or die $!; } } + exit(0); } sub file_diff -- 1.7.11.2.255.g5f133da -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at
[PATCH 3/5] difftool: Move option values into a hash
Shorten the my declaration for all of the option-specific variables by wrapping all of them in a hash. This also gives us a place to specify default values, should we need them. Signed-off-by: David Aguilar dav...@gmail.com --- Fixed typo in the commit message git-difftool.perl | 55 +++ 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/git-difftool.perl b/git-difftool.perl index 41ba932..0ce6168 100755 --- a/git-difftool.perl +++ b/git-difftool.perl @@ -264,41 +264,48 @@ sub main { # parse command-line options. all unrecognized options and arguments # are passed through to the 'git diff' command. - my ($difftool_cmd, $dirdiff, $extcmd, $gui, $help, $prompt, $tool_help); - GetOptions('g|gui!' = \$gui, - 'd|dir-diff' = \$dirdiff, - 'h' = \$help, - 'prompt!' = \$prompt, - 'y' = sub { $prompt = 0; }, - 't|tool:s' = \$difftool_cmd, - 'tool-help' = \$tool_help, - 'x|extcmd:s' = \$extcmd); - - if (defined($help)) { + my %opts = ( + difftool_cmd = undef, + dirdiff = undef, + extcmd = undef, + gui = undef, + help = undef, + prompt = undef, + tool_help = undef, + ); + GetOptions('g|gui!' = \$opts{gui}, + 'd|dir-diff' = \$opts{dirdiff}, + 'h' = \$opts{help}, + 'prompt!' = \$opts{prompt}, + 'y' = sub { $opts{prompt} = 0; }, + 't|tool:s' = \$opts{difftool_cmd}, + 'tool-help' = \$opts{tool_help}, + 'x|extcmd:s' = \$opts{extcmd}); + + if (defined($opts{help})) { usage(0); } - if (defined($tool_help)) { + if (defined($opts{tool_help})) { print_tool_help(); } - if (defined($difftool_cmd)) { - if (length($difftool_cmd) 0) { - $ENV{GIT_DIFF_TOOL} = $difftool_cmd; + if (defined($opts{difftool_cmd})) { + if (length($opts{difftool_cmd}) 0) { + $ENV{GIT_DIFF_TOOL} = $opts{difftool_cmd}; } else { print No tool given for --tool=tool\n; usage(1); } } - if (defined($extcmd)) { - if (length($extcmd) 0) { - $ENV{GIT_DIFFTOOL_EXTCMD} = $extcmd; + if (defined($opts{extcmd})) { + if (length($opts{extcmd}) 0) { + $ENV{GIT_DIFFTOOL_EXTCMD} = $opts{extcmd}; } else { print No cmd given for --extcmd=cmd\n; usage(1); } } - if ($gui) { - my $guitool = ''; - $guitool = Git::config('diff.guitool'); + if ($opts{gui}) { + my $guitool = Git::config('diff.guitool'); if (length($guitool) 0) { $ENV{GIT_DIFF_TOOL} = $guitool; } @@ -308,10 +315,10 @@ sub main # to compare the a/b directories. In file diff mode, 'git diff' # will invoke a separate instance of 'git-difftool--helper' for # each file that changed. - if (defined($dirdiff)) { - dir_diff($extcmd); + if (defined($opts{dirdiff})) { + dir_diff($opts{extcmd}); } else { - file_diff($prompt); + file_diff($opts{prompt}); } } -- 1.7.11.2.255.g5f133da -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
disabling nls in git?
What is the best way to compile git without nls support? It doesn't seem to be possible with configure, though running make NO_GETTEXT=y seems to work. Is there a more elegant way to do it? -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: git with large files...
On Mon, Jul 23, 2012 at 2:24 AM, Junio C Hamano gits...@pobox.com wrote: mer...@stonehenge.com (Randal L. Schwartz) writes: Darek == Darek Bridges darek.brid...@me.com writes: Darek I use git for many things, but I am trying to work out the Darek workflow to use git for deployment. Don't. Yeah, don't think 'git checkout' is a way to 'deploy'. Using Git as a transport measure is probably fine. You can also try http://sitaramc.github.com/the-list-and-irc/deploy.html. Whether it's saying you *can* use git for deploying something, or you *can* but *should not*, or you *cannot*, will depend on your own thoughts on the matter ;-) -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH lt/block-sha1 0/2 v3] block-sha1: avoid pointer conversion that violates alignment constraints
Jonathan Nieder jrnie...@gmail.com writes: This is a series of two patches: the first avoids alignment faults that were making git either slow on Alpha machines or crashy, depending on the machine's configuration, and the second patch is a cosmetic nit noticed while reviewing the first. ... Thoughts? Jonathan Thanks. Did somebody actually compiled Git for Alpha, and even more surprisingly on a big-endian variant of one? -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 0/7] i18n for git-am, git-rebase and git-merge
Jiang Xin worldhello@gmail.com writes: 2012/7/23 Junio C Hamano gits...@pobox.com: I do not understand why many of these have Stefano's S-o-b in them. If you are relaying what Stefano originally wrote, then the author (i.e. From: ) and the first S-o-b would say Stefano, and your S-o-b will follow it, but that is probably not the case. I'll drop the S-o-b lines for now. It is because Stefano offers lots of help for correcting syntax errors and misspellings in the original commit logs. Should I use Reviewed-by tag instead of S-o-b? Yeah, I guessed that you meant reviewed-by. And in PATCH 3/7, there is a Ævar's S-o-b, it is because the workaround comes from Ævar's idea. This one I remember the previous round, so didn't have any problem. By the way, is there any existing test that needs to gain GETTEXT_POISON or test_i18ncmp with this change? I find one test case failed, and correct it in PATCH 3/7. That test used i18ncmp already, so the update to expected string would be sufficient. I was worried if there were existing tests that have been expecting that the output from am/rebase/merge would not be i18n'ised and using test_cmp expect actual to compare their output with expected result. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH lt/block-sha1 0/2 v3] block-sha1: avoid pointer conversion that violates alignment constraints
Junio C Hamano wrote: Thanks. Did somebody actually compiled Git for Alpha, and even more surprisingly on a big-endian variant of one? Logs from building for Alpha and running the test suite are here: http://buildd.debian-ports.org/status/logs.php?pkg=gitarch=alpha The big-endian part was just my idiocy, sorry. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 5/5] difftool: Use symlinks when diffing against the worktree
David Aguilar dav...@gmail.com writes: + # Do not copy back files when symlinks are used + if ($symlinks) { + exit(0); + } + Isn't this a bit risky, depending on the behaviour of the tool that eventually lead the user to invoke his favorite editor to muck with the files in the temporary directory? I think most sane people and their editors would follow symlinks and update the file the symlink points at when writing out the modified contents, but it should not be too much trouble to detect the case in which the editor unlinked the symlink and recreated a regular file in its place, and copy the file back when that happened, to make it even safer, no? The most lazy solution would be to just remove the above block, and let the compare() compare the symlink $b/$file and the working tree file $workdir/$file that is pointed by it. We will find data losing case where the editor unlinks and creates that way automatically. Optionally, you can update if (-e $b/$file compare($b/$file, $workdir/$file)) { with if (! -l $b/$file -f _ compare($b/$file, $workdir/$file)) { to avoid the cost of comparison. # If the diff including working copy files and those # files were modified during the diff, then the changes # should be copied back to the working tree + for my $file (@working_tree) { if (-e $b/$file compare($b/$file, $workdir/$file)) { copy($b/$file, $workdir/$file) or die $!; - chmod(stat($b/$file)-mode, $workdir/$file) or die $!; + my $mode = stat($b/$file)-mode; + chmod($mode, $workdir/$file) or die $!; } } + exit(0); } Other than that, the series looked well thought-out. Thanks. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Solve git-submodule issues with detached work trees
Daniel Graña dan...@gmail.com writes: A common way to track dotfiles with git is using GIT_DIR and GIT_WORK_TREE to move repository out of ~/.git with something like: git init --bare ~/.dotfiles alias dotfiles=GIT_DIR=~/.dotfiles GIT_WORK_TREE=~ git dotfiles add ~/.bashrc dotfiles commit -a -m add my bashrc ... but git-submodule complains when trying to add submodules: dotfiles submodule add http://path.to/submodule fatal: working tree '/home/user' already exists. git --git-dir ~/.dotfiles submodule add http://path.to/submodule fatal: /usr/lib/git-core/git-submodule cannot be used without a working tree. Signed-off-by: Daniel Graña dan...@gmail.com --- I think this is in line with what we discussed earlier on list when the interaction between GIT_DIR/GIT_WORK_TREE and submodules came up the last time. Jens? git-submodule.sh |7 +++- t/t7409-submodule-detached-worktree.sh | 61 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100755 t/t7409-submodule-detached-worktree.sh diff --git a/git-submodule.sh b/git-submodule.sh index 5629d87..88ee4ea 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -181,8 +181,11 @@ module_clone() rm -f $gitdir/index else mkdir -p $gitdir_base - git clone $quiet -n ${reference:+$reference} \ - --separate-git-dir $gitdir $url $sm_path || + ( + clear_local_git_env + git clone $quiet -n ${reference:+$reference} \ + --separate-git-dir $gitdir $url $sm_path + ) || die $(eval_gettext Clone of '\$url' into submodule path '\$sm_path' failed) Line-wrapped broken patch? fi diff --git a/t/t7409-submodule-detached-worktree.sh b/t/t7409-submodule-detached-worktree.sh new file mode 100755 index 000..db75642 --- /dev/null +++ b/t/t7409-submodule-detached-worktree.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Copyright (c) 2012 Daniel Graña +# + +test_description='Test submodules on detached working tree + +This test verifies that git submodule initialization, update and addition works Line-wrapped broken patch? +on detahced working trees +' + +TEST_NO_CREATE_REPO=1 +. ./test-lib.sh + +test_expect_success 'submodule on detached working tree' ' + git init --bare remote + test_create_repo bundle1 + (cd bundle1 test_commit shoot) + mkdir home + ( + cd home + export GIT_WORK_TREE=$(pwd) GIT_DIR=$(pwd)/.dotfiles + git clone --bare ../remote .dotfiles + git submodule add ../bundle1 .vim/bundle/sogood + test_commit sogood + git push origin master + ) Don't you want to verify not just commands succeed, but leave a reasonable result, e.g. by running git rev-parse HEAD in remote and comparing the output with git rev-parse HEAD in .dotfiles, or something? + mkdir home2 + ( + cd home2 + export GIT_WORK_TREE=$(pwd) GIT_DIR=$(pwd)/.dotfiles + git clone --bare ../remote .dotfiles + git submodule update --init Likewise. What state, other than submodule update --init does not barf, do you expect to see? + ) +' + +test_expect_success 'submodule on detached working pointed by core.worktree' ' + mkdir home3 + ( + cd home3 + export GIT_DIR=$(pwd)/.dotfiles + git clone --bare ../remote $GIT_DIR + git config core.bare false + git config core.worktree .. + git submodule add ../bundle1 .vim/bundle/dupe + test_commit dupe + git push origin master Likewise. + ) + ( + cd home + export GIT_DIR=$(pwd)/.dotfiles + git config core.bare false + git config core.worktree .. + git pull + git submodule update + git submodule status + test -d .vim/bundle/dupe Likewise. Is there something you want to verify in the branches in the submodule and its working tree, other than the existence of that directory? + ) +' + +test_done -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH lt/block-sha1 0/2 v3] block-sha1: avoid pointer conversion that violates alignment constraints
Jonathan Nieder jrnie...@gmail.com writes: Junio C Hamano wrote: Thanks. Did somebody actually compiled Git for Alpha, and even more surprisingly on a big-endian variant of one? Logs from building for Alpha and running the test suite are here: http://buildd.debian-ports.org/status/logs.php?pkg=gitarch=alpha The big-endian part was just my idiocy, sorry. Hrm, do we want an update log message for 1/2 then? -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Makefile: fix location of listing produced by make subdir/foo.s
Jonathan Nieder jrnie...@gmail.com writes: When I invoke make block-sha1/sha1.s, 'make' runs $(CC) -S without specifying where it should put its output and the output ends up in ./sha1.s. Confusing. Add an -o option to the .s rule to fix this. We were already doing that for most compiler invocations but had forgotten it for the assembler listings. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Hi, This patch is from below the scissors at http://thread.gmane.org/gmane.comp.version-control.git/201434/focus=201485 I think it's a good change, but as usual it's nice if someone else takes a look at it and gives it a sanity check. If it seems sane, I'd be happy to see it applied. What do you think? Thanks, Jonathan Yeah, I think it is a sensible thing to do. Makefile |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 285c660e..8bfa19cd 100644 --- a/Makefile +++ b/Makefile @@ -2263,7 +2263,7 @@ $(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs) endif %.s: %.c GIT-CFLAGS FORCE - $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $ + $(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $ ifdef USE_COMPUTED_HEADER_DEPENDENCIES # Take advantage of gcc's on-the-fly dependency generation -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 0/5] difftool: Use symlinks in dir-diff mode
On Sun, Jul 22, 2012 at 10:14 PM, Junio C Hamano gits...@pobox.com wrote: David Aguilar dav...@gmail.com writes: Teach the difftool script to use symlinks when doing directory diffs in --dir-diff mode. This is v2 of the patch because I had a typo in one of the commit messages and gmail ate 4/5 in the last round. FWIW, I received all including 4/5 in my inboxes (at pobox and gmail---I am doubly subscribed). I still haven't figured out what in the original 4/5 was so special to be dropped somewhere in between. I hastily blamed gmail but of course it was vger's spam filters. The original subject said git-difftool.X. The exes triggered it. -- David -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html