summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2008-08-28Remove calculation of the longest command name from where it is not usedLibravatar Alex Riesen4-28/+24
Just calculate it where it is needed - it is cheap and trivial, as all the lengths are already there (stored when creating the command lists). Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-28dir.c: Avoid c99 array initializationLibravatar Brandon Casey3-16/+10
The following syntax: char foo[] = { [0] = 1, [7] = 2, [15] = 3 }; is a c99 construct which some compilers do not support even though they support other c99 constructs. This construct can be avoided by folding these 'special' test cases into the sane_ctype array and making use of the related infrastructure. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-28bash-completion: Add all submodule subcommands to the completion listLibravatar Matthias Kestenholz1-1/+1
Signed-off-by: Matthias Kestenholz <mk@spinlock.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-27Merge branch 'mv/merge-custom'Libravatar Junio C Hamano8-508/+627
* mv/merge-custom: t7606: fix custom merge test Fix "git-merge -s bogo" help text Update .gitignore to ignore git-help Builtin git-help. builtin-help: always load_command_list() in cmd_help() Add a second testcase for handling invalid strategies in git-merge Add a new test for using a custom merge strategy builtin-merge: allow using a custom strategy builtin-help: make some internal functions available to other builtins Conflicts: help.c
2008-08-27Merge branch 'ml/submodule'Libravatar Junio C Hamano1-1/+2
* ml/submodule: git-submodule.sh - Remove trailing / from URL if found git-submodule.sh - Remove trailing / from URL if found
2008-08-27Merge branch 'am/cherry-pick-rerere'Libravatar Junio C Hamano2-0/+47
* am/cherry-pick-rerere: Make cherry-pick use rerere for conflict resolution.
2008-08-27Merge branch 'jc/add-addremove'Libravatar Junio C Hamano3-69/+93
* jc/add-addremove: builtin-add.c: optimize -A option and "git add ." builtin-add.c: restructure the code for maintainability
2008-08-27Merge branch 'np/verify-pack'Libravatar Junio C Hamano5-1/+22
* np/verify-pack: discard revindex data when pack list changes
2008-08-27Merge branch 'da/submodule-sync'Libravatar Junio C Hamano2-2/+55
* da/submodule-sync: git-submodule: add "sync" command
2008-08-27Merge branch 'maint'Libravatar Junio C Hamano3-1/+6
* maint: ctype.c: protect tiny C preprocessor constants index-pack: be careful after fixing up the header/footer
2008-08-27ctype.c: protect tiny C preprocessor constantsLibravatar Junio C Hamano1-0/+5
Some platforms contaminate the preprocessor token namespace with their own definition of SS without being asked. Avoid getting hit by redefinition warning messages by explicitly undef SS, AA and DD shorthand we use in this table definition. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-27index-pack: be careful after fixing up the header/footerLibravatar Linus Torvalds2-1/+1
The index-pack command, when processing a thin pack, fixed up the pack after-the-fact. It forgets to fsync the result, because it only did that in one path rather in all cases of fixup. This moves the fsync_or_die() to the fix-up routine itself, rather than doing it in one of the callers, so that all cases are covered. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-27Make it possible to abort the submission of a change to PerforceLibravatar Simon Hausmann1-8/+23
Currently it is not possible to skip the submission of a change to Perforce when running git-p4 submit. This patch compares the modification time before and after the submit editor invokation and offers a prompt for skipping if the submit template file was not saved. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-26Merge branch 'af/maint-install-no-handlink'Libravatar Junio C Hamano1-11/+11
* af/maint-install-no-handlink: Makefile: always provide a fallback when hardlinks fail
2008-08-26Merge branch 'jc/no-slim-shell'Libravatar Junio C Hamano4-6/+3
* jc/no-slim-shell: Revert "Build-in "git-shell""
2008-08-26Merge branch 'maint'Libravatar Junio C Hamano9-35/+46
* maint: index-pack: setup git repository Suppress some bash redirection error messages Fix a warning (on cygwin) to allow -Werror Fix "git log -i --grep"
2008-08-26format-patch: use default diff format even with patch optionsLibravatar Jeff King2-1/+27
Previously, running "git format-patch -U5" would cause the low-level diff machinery to change the diff output format from "not specified" to "patch". This meant that format-patch thought we explicitly specified a diff output format, and would not use the default format. The resulting message lacked both the diffstat and the summary, as well as the separating "---". Now format-patch explicitly checks for this condition and uses the default. That means that "git format-patch -p" will now have the "-p" ignored. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-26index-pack: setup git repositoryLibravatar Nguyễn Thái Ngọc Duy1-0/+2
"git index-pack" is an independent command and does not setup git repository while still need pack.indexversion. It may miss the info if it is in a subdirectory of the repository. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-26Suppress some bash redirection error messagesLibravatar Ramsay Jones3-10/+4
In particular, when testing if the filesystem allows tabs in filenames, bash issues an error something like: ./t4016-diff-quote.sh: pathname with HT: No such file or directory which is caused by the failure of the (stdout) redirection, since the file cannot be created. In order to suppress the error message, you must redirect stderr to /dev/null, *before* the stdout redirection on the command-line. Also, remove a redundant filesystem check from the begining of the t3902-quoted.sh test and standardise the "test skipped" message to 'say' on exit. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-26Fix a warning (on cygwin) to allow -WerrorLibravatar Ramsay Jones1-1/+2
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-25Makefile: always provide a fallback when hardlinks failLibravatar Andreas Färber1-11/+11
We make hardlinks from "git" to "git-<cmd>" built-ins and have been careful to avoid cross-device links when linking "git-<cmd>" to gitexecdir. However, we were not prepared to deal with a build directory that is incapable of making hard links within itself. This patch corrects it. Instead of temporarily linking "git" to gitexecdir, directly link "git- add", falling back to "cp". Try hardlinking that as "git-<cmd>", falling back to symlinks or "cp" on error. While at it, avoid 100+ error messages from hardlink failures when we are going to fall back to symlinks or "cp" by redirecting the standard error to /dev/null. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-25git-submodule: add "sync" commandLibravatar David Aguilar2-2/+55
When a submodule's URL changes upstream, existing submodules will be out of sync since their remote."$origin".url will still be set to the old value. This adds a "git submodule sync" command that reads submodules' URLs from .gitmodules and updates them accordingly. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-25Revert "Build-in "git-shell""Libravatar Junio C Hamano4-6/+3
This reverts commit daa0cc9a92c9c2c714aa5f7da6d0ff65b93e0698. It was a stupid idea to do this; when run as a log-in shell, it is spawned with argv[0] set to "-git-shell", so the usual name-based dispatch would not work to begin with.
2008-08-24Fix "git log -i --grep"Libravatar Jeff King4-24/+38
This has been broken in v1.6.0 due to the reorganization of the revision option parsing code. The "-i" is completely ignored, but works fine in "git log --grep -i". What happens is that the code for "-i" looks for revs->grep_filter; if it is NULL, we do nothing, since there are no grep filters. But that is obviously not correct, since we want it to influence the later --grep option. Doing it the other way around works, since "-i" just impacts the existing grep_filter option. Instead, we now always initialize the grep_filter member and just fill in options and patterns as we get them. This means that we can no longer check grep_filter for NULL, but instead must check the pattern list to see if we have any actual patterns. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24Install git-shell in bindir, tooLibravatar Tommi Virtanen1-1/+1
/etc/passwd shell field must be something execable, you can't enter "/usr/bin/git shell" there. git-shell must be present as a separate executable, or it is useless. Signed-off-by: Tommi Virtanen <tv@eagain.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24Merge branch 'jc/no-slim-shell'Libravatar Junio C Hamano4-19/+7
* jc/no-slim-shell: Build-in "git-shell" shell: do not play duplicated definition games to shrink the executable
2008-08-24Merge branch 'maint' to sync with 1.6.0.1Libravatar Junio C Hamano11-52/+126
2008-08-24GIT 1.6.0.1Libravatar Junio C Hamano1-6/+11
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24Merge branch 'ag/maint-combine-diff-fix' into maintLibravatar Junio C Hamano2-0/+28
* ag/maint-combine-diff-fix: Respect core.autocrlf in combined diff
2008-08-24Merge branch 'mv/maint-merge-fix' into maintLibravatar Junio C Hamano4-8/+32
* mv/maint-merge-fix: merge: fix numerus bugs around "trivial merge" area
2008-08-24git-submodule - Use "get_default_remote" from git-parse-remoteLibravatar Mark Levedahl1-3/+2
Resolve_relative_url was using its own code for this function, but this is duplication with the best result that this continues to work. Replace with the common function provided by git-parse-remote. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24Documentation: clarify pager configurationLibravatar Jonathan Nieder2-3/+9
The unwary user may not know how to disable the -FRSX options. Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24Documentation: clarify pager.<cmd> configurationLibravatar Jonathan Nieder1-3/+5
It was not obvious from the text that pager.<cmd> is a boolean setting. While we're changing the description, make some other improvements: lest we forget and fret, clarify that -p and pager.<cmd> do not kick in when stdout is not a tty; point to related core.pager and GIT_PAGER settings; use renamed --paginate option. Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24Clean up the git-p4 documentationLibravatar Simon Hausmann1-31/+38
This patch massages the documentation a bit for improved readability and cleans it up from outdated options/commands. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-23Respect core.autocrlf in combined diffLibravatar Alexander Gavrilov2-0/+28
Fix git-diff to make it produce useful 3-way diffs for merge conflicts in repositories with autocrlf enabled. Otherwise it always reports that the whole file was changed, because it uses the contents from the working tree without necessary conversion. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-23Makefile: enable SNPRINTF_RETURNS_BOGUS for HP-UXLibravatar Miklos Vajna1-0/+1
In 81cc66a, customization has been added to Makefile for supporting HP-UX, but git commit is still problematic. This should fix the issue. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Acked-by: Robert Schiele <rschiele@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-23t7606: fix custom merge testLibravatar Junio C Hamano1-2/+5
Custom merge strategy does not even kick in when the merge is truly trivial. The test depended on the behaviour in the git-merge rewritten in C that broke the trivial merge completely. Make the test to work on a non-trivial merge to make sure the strategy kicks in. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-23Merge branch 'maint'Libravatar Junio C Hamano6-5/+10
* maint: unpack_trees(): protect the handcrafted in-core index from read_cache() git-p4: Fix one-liner in p4_write_pipe function. Completion: add missing '=' for 'diff --diff-filter' Fix 'git help help'
2008-08-23merge: fix numerus bugs around "trivial merge" areaLibravatar Junio C Hamano4-8/+32
The "trivial merge" codepath wants to optimize itself by making an internal call to the read-tree machinery, but it does not read the index before doing so, and the codepath is never exercised. Incidentally, this failure to read the index upfront means that the safety to refuse doing anything when the index is unmerged does not kick in, either. These two problem are fixed by using read_cache_unmerged() that does read the index before checking if it is unmerged at the beginning of cmd_merge(). The primary logic of the merge, however, assumes that the process never reads the index in-core, and the call to write_cache_as_tree() it makes from write_tree_trivial() will always read from the on-disk index that is prepared the strategy back-ends. This assumption is now broken by the above fix. To fix this issue, we now call discard_cache() before calling write_tree_trivial() when it wants to write the on-disk index as a tree. When multiple strategies are tried, their results are evaluated by reading the resulting index and inspecting it. The codepath needs to make a call to read_cache() for each successful strategy, and for that to work, they need to discard_cache() the one read by the previous round. Also the "trivial merge" forgot that the current commit is one of the parents of the resulting commit. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-23unpack_trees(): protect the handcrafted in-core index from read_cache()Libravatar Junio C Hamano3-2/+6
unpack_trees() rebuilds the in-core index from scratch by allocating a new structure and finishing it off by copying the built one to the final index. The resulting in-core index is Ok for most use, but read_cache() does not recognize it as such. The function is meant to be no-op if you already have loaded the index, until you call discard_cache(). This change the way read_cache() detects an already initialized in-core index, by introducing an extra bit, and marks the handcrafted in-core index as initialized, to avoid this problem. A better fix in the longer term would be to change the read_cache() API so that it will always discard and re-read from the on-disk index to avoid confusion. But there are higher level API that have relied on the current semantics, and they and their users all need to get converted, which is outside the scope of 'maint' track. An example of such a higher level API is write_cache_as_tree(), which is used by git-write-tree as well as later Porcelains like git-merge, revert and cherry-pick. In the longer term, we should remove read_cache() from there and add one to cmd_write_tree(); other callers expect that the in-core index they prepared is what gets written as a tree so no other change is necessary for this particular codepath. The original version of this patch marked the index by pointing an otherwise wasted malloc'ed memory with o->result.alloc, but this version uses Linus's idea to use a new "initialized" bit, which is conceptually much cleaner. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22git-p4: Fix one-liner in p4_write_pipe function.Libravatar Tor Arvid Lund1-1/+1
The function built a p4 command string via the p4_build_cmd function, but ignored the result. Signed-off-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22git-submodule: replace duplicated code with a module_list functionLibravatar David Aguilar1-4/+13
Several call sites in git-submodule.sh used the same idiom for getting submodule information: git ls-files --stage -- "$@" | grep '^160000 ' This patch removes this duplication by introducing a module_list function. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22discard revindex data when pack list changesLibravatar Nicolas Pitre5-1/+22
This is needed to fix verify-pack -v with multiple pack arguments. Also, in theory, revindex data (if any) must be discarded whenever reprepare_packed_git() is called. In practice this is hard to trigger though. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22git-merge documentation: more details about resolving conflictsLibravatar Dan Hensgen1-6/+18
Signed-off-by: Dan Hensgen <dan@methodhead.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22Extend "checkout --track" DWIM to support more casesLibravatar Alex Riesen4-17/+46
The code handles additionally "refs/remotes/<something>/name", "remotes/<something>/name", and "refs/<namespace>/name". Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22Revert "Convert output messages in merge-recursive to past tense."Libravatar Jonathan del Strother1-18/+18
During a conflicting merge, you would typically see: Auto-merged foo.txt CONFLICT (content): Merge conflict in foo.txt Recorded preimage for 'foo.txt' Automatic merge failed; fix conflicts and then commit the result. and left wondering what happened to "foo.txt". Did it succeed, and then conflicted, and then what? This is because historically there was a progress bar displayed before the auto-merge is mentioned, and it was expected to take long time, before we can say "Auto-merged foo.txt". It turns out it was not the case, and the original wording "Auto-merging foo.txt" we used to have before 89f40be (Convert output messages in merge-recursive to past tense., 2007-01-14) is better. Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22Completion: add missing '=' for 'diff --diff-filter'Libravatar Eric Raible1-1/+1
Signed-off-by: Eric Raible <raible@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22templates/Makefile: install is unnecessary, just use mkdir -pLibravatar Junio C Hamano1-2/+2
The native install on some platforms (namely IRIX 6.5) treats non-absolute paths as being relative to the root directory rather than relative to the current directory. Work around this by avoiding install in this case since it is unnecessary, and instead depend on the local umask setting and use mkdir. Tested-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22remote.c: add a function for deleting a refspec array and use it (twice)Libravatar Brandon Casey2-2/+28
A number of call sites allocate memory for a refspec array, populate its members with heap memory, and then free only the refspec pointer while leaking the memory allocated for the member elements. Provide a function for freeing the elements of a refspec array and the array itself. Caution to callers: code paths must be checked to ensure that the refspec members "src" and "dst" can be passed to free. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-21filter-branch: Grok special characters in tag namesLibravatar Johannes Sixt2-5/+15
The tag rewriting code used a 'sed' expression to substitute the new tag name into the corresponding field of the annotated tag object. But this is problematic if the tag name contains special characters. In particular, if the tag name contained a slash, then the 'sed' expression had a syntax error. We now protect against this by using 'printf' to assemble the tag header. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>