summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2008-02-25help: respect aliasesJeff King
If we have an alias "foo" defined, then the help text for "foo" (via "git help foo" or "git foo --help") now shows the definition of the alias. Before showing an alias definition, we make sure that there is no git command which would override the alias (so that even though you may have a "log" alias, even though it will not work, we don't want to it supersede "git help log"). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-25make alias lookup a public, procedural functionJeff King
This converts git_config_alias to the public alias_lookup function. Because of the nature of our config parser, we still have to rely on setting static data. However, that interface is wrapped so that you can just say value = alias_lookup(key); Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-25help: use parseoptJeff King
This patch converts cmd_help to use parseopt, along with a few style cleanups, including: - enum constants are now ALL_CAPS - parse_help_format returns an enum value rather than setting a global as a side effect Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-23Sync with 1.5.4.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-23GIT 1.5.4.3v1.5.4.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-23Merge branch 'maint' of git://repo.or.cz/git-gui into maintJunio C Hamano
* 'maint' of git://repo.or.cz/git-gui: git-gui: Focus insertion point at end of strings in repository chooser git-gui: Avoid hardcoded Windows paths in Cygwin package files git-gui: Default TCL_PATH to same location as TCLTK_PATH git-gui: Paper bag fix error dialogs opening over the main window git-gui: Ensure error dialogs always appear over all other windows git-gui: relax "dirty" version detection git-gui: support Git Gui.app under OS X 10.5
2008-02-23pull: pass --strategy along to to rebaseJay Soffian
rebase supports --strategy, so pull should pass the option along to it. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-23Use helper function for copying index entry informationLinus Torvalds
We used to just memcpy() the index entry when we copied the stat() and SHA1 hash information, which worked well enough back when the index entry was just an exact bit-for-bit representation of the information on disk. However, these days we actually have various management information in the cache entry too, and we should be careful to not overwrite it when we copy the stat information from another index entry. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-23Name hash fixups: export (and rename) remove_hash_entryLinus Torvalds
This makes the name hash removal function (which really just sets the bit that disables lookups of it) available to external routines, and makes read_cache_unmerged() use it when it drops an unmerged entry from the index. It's renamed to remove_index_entry(), and we drop the (unused) 'istate' argument. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-23Fix name re-hashing semanticsLinus Torvalds
We handled the case of removing and re-inserting cache entries badly, which is something that merging commonly needs to do (removing the different stages, and then re-inserting one of them as the merged state). We even had a rather ugly special case for this failure case, where replace_index_entry() basically turned itself into a no-op if the new and the old entries were the same, exactly because the hash routines didn't handle it on their own. So what this patch does is to not just have the UNHASHED bit, but a HASHED bit too, and when you insert an entry into the name hash, that involves: - clear the UNHASHED bit, because now it's valid again for lookup (which is really all that UNHASHED meant) - if we're being lazy, we're done here (but we still want to clear the UNHASHED bit regardless of lazy mode, since we can become unlazy later, and so we need the UNHASHED bit to always be set correctly, even if we never actually insert the entry into the hash list) - if it was already hashed, we just leave it on the list - otherwise mark it HASHED and insert it into the list this all means that unhashing and rehashing a name all just works automatically. Obviously, you cannot change the name of an entry (that would be a serious bug), but nothing can validly do that anyway (you'd have to allocate a new struct cache_entry anyway since the name length could change), so that's not a new limitation. The code actually gets simpler in many ways, although the lazy hashing does mean that there are a few odd cases (ie something can be marked unhashed even though it was never on the hash in the first place, and isn't actually marked hashed!). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-22Merge branch 'maint'Junio C Hamano
* maint: hash: fix lookup_hash semantics
2008-02-22hash: fix lookup_hash semanticsJeff King
We were returning the _address of_ the stored item (or NULL) instead of the item itself. While this sort of indirection is useful for insertion (since you can lookup and then modify), it is unnecessary for read-only lookup. Since the hash code splits these functions between the internal lookup_hash_entry function and the public lookup_hash function, it makes sense for the latter to provide what users of the library expect. The result of this was that the index caching returned bogus results on lookup. We unfortunately didn't catch this because we were returning a "struct cache_entry **" as a "void *", and accidentally assigning it to a "struct cache_entry *". As it happens, this actually _worked_ most of the time, because the entries were defined as: struct cache_entry { struct cache_entry *next; ... }; meaning that interpreting a "struct cache_entry **" as a "struct cache_entry *" would yield an entry where all fields were totally bogus _except_ for the next pointer, which pointed to the actual cache entry. When walking the list, we would look at the bogus "name" field, which was unlikely to match our lookup, and then proceed to the "real" entry. The reading of bogus data was silently ignored most of the time, but could cause a segfault for some data (which seems to be more common on OS X). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-22gitweb: Better chopping in commit search resultsJunio C Hamano
When searching commit messages (commit search), if matched string is too long, the generated HTML was munged leading to an ill-formed XHTML document. Now gitweb chop leading, trailing and matched parts, HTML escapes those parts, then composes and marks up match info. HTML output is never chopped. Limiting matched info to 80 columns (with slop) is now done by dividing remaining characters after chopping match equally to leading and trailing part, not by chopping composed and HTML marked output. Noticed-by: Jean-Baptiste Quenot <jbq@caraldi.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-22builtin-tag.c: remove cruftGerrit Pape
After changing builtin-tag.c to use strbuf in fd17f5b (Replace all read_fd use with strbuf_read, and get rid of it.), the last condition in do_sign() will always be false, as it's checked already right above. So let's remove the cruft. Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-22git-merge-index documentation: clarify synopsisGerrit Pape
The options following <merge-program> are not -a, --, or <file>..., but either -a, or -- <file>..., while -- is optional. Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-22git-gui: Focus insertion point at end of strings in repository chooserShawn O. Pearce
When selecting a local working directory for a new repository or a location to clone an existing repository into we now set the insert point at the end of the selected path, allowing the user to type in any additional parts of the path if they so desire. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-22git-gui: Avoid hardcoded Windows paths in Cygwin package filesShawn O. Pearce
When we are being built by the Cygwin package maintainers we need to embed the POSIX path to our library files and not the Windows path. Embedding the Windows path means all end-users who install our Cygwin package would be required to install Cygwin at the same Windows path as the package maintainer had Cygwin installed to. This requirement is simply not user-friendly and may be infeasible for a large number of our users. We now try to auto-detect if the Tcl/Tk binary we will use at runtime is capable of translating POSIX paths into Windows paths the same way that cygpath does the translations. If the Tcl/Tk binary gives us the same results then it understands the Cygwin path translation process and should be able to read our library files from a POSIX path name. If it does not give us the same answer as cygpath then the Tcl/Tk binary might actually be a native Win32 build (one that is not linked against Cygwin) and thus requires the native Windows path to our library files. We can assume this is not a Cygwin package as the Cygwin maintainers do not currently ship a pure Win32 build of Tcl/Tk. Reported on the git mailing list by Jurko Gospodnetić. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-22git-gui: Default TCL_PATH to same location as TCLTK_PATHShawn O. Pearce
Most users set TCLTK_PATH to tell git-gui where to find wish, but they fail to set TCL_PATH to the same Tcl installation. We use the non-GUI tclsh during builds so headless systems are still able to create an index file and create message files without GNU msgfmt. So it matters to us that we find a working TCL_PATH at build time. If TCL_PATH hasn't been set yet we can take a better guess about what tclsh executable to use by replacing 'wish' in the executable path with 'tclsh'. We only do this replacement on the filename part of the path, just in case the string "wish" appears in the directory paths. Most of the time the tclsh will be installed alongside wish so this replacement is a sensible and safe default. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-22git-gui: Paper bag fix error dialogs opening over the main windowShawn O. Pearce
If the main window is the only toplevel we have open then we don't have a valid grab right now, so we need to assume the best toplevel to use for the parent is ".". Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-22send-email: fix In-Reply-To regressionJay Soffian
Fix a regression introduced by 1ca3d6e (send-email: squelch warning due to comparing undefined $_ to "") where if the user was prompted for an initial In-Reply-To and didn't provide one, messages would be sent out with an invalid In-Reply-To of "<>" Also add test cases for the regression and the fix. A small modification was needed to allow send-email to take its replies from stdin if the environment variable GIT_SEND_EMAIL_NOTTY is set. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-21git-reset --hard and git-read-tree --reset: fix read_cache_unmerged()Junio C Hamano
When invalidating unmerged entries in the index, we used to set their ce_mode to 0 to note the fact that they do not matter anymore which also made sure that later unpack_trees() call would not reuse them. Instead just remove them from the index. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-21git-gui: Ensure error dialogs always appear over all other windowsShawn O. Pearce
If we are opening an error dialog we want it to appear above all of the other windows, even those that we may have opened with a grab to make the window modal. Failure to do so may allow an error dialog to open up (and grab focus!) under an existing toplevel, making the user think git-gui has frozen up and is unresponsive, as they cannot get to the dialog. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-21Teach git-grep --name-only as synonym for -lShawn O. Pearce
I expected git grep --name-only to give me only the file names, much as git diff --name-only only generates filenames. Alas the option is -l, which matches common external greps but doesn't match other parts of the git UI. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-21diff: fix java funcname pattern for solarisJeff King
The Solaris regex library doesn't like having the '$' anchor inside capture parentheses. It rejects the match, causing t4018 to fail. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-21t3404: use configured shell instead of /bin/shJeff King
The fake-editor shell script invoked /bin/sh; normally this is fine, unless the /bin/sh doesn't meet our compatibility requirements, as is the case with Solaris. Specifically, the $() syntax used by fake-editor is not understood. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-21git_config_*: don't assume we are parsing a config fileJeff King
These functions get called by other code, including parsing config options from the command line. In that case, config_file_name is NULL, leading to an ugly message or even a segfault on some implementations of printf. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-21prefix_path: use is_absolute_path() instead of *orig == '/'Johannes Sixt
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-21git-clean: handle errors if removing files failsMiklos Vajna
git-clean simply ignored errors if removing a file or directory failed. This patch makes it raise a warning and the exit code also greater than zero if there are remaining files. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-21Merge branch 'mk/color'Junio C Hamano
* mk/color: Add color.ui variable which globally enables colorization if set
2008-02-21Merge branch 'js/maint-cvsexport'Junio C Hamano
* js/maint-cvsexport: cvsexportcommit: be graceful when "cvs status" reorders the arguments Conflicts: t/t9200-git-cvsexportcommit.sh
2008-02-21Merge branch 'js/maint-http-push'Junio C Hamano
* js/maint-http-push: http-push: avoid a needless goto http-push: do not get confused by submodules http-push: avoid invalid memory accesses
2008-02-21Merge branch 'jk/empty-tree'Junio C Hamano
* jk/empty-tree: add--interactive: handle initial commit better hard-code the empty tree object
2008-02-21Merge branch 'lt/revision-walker'Junio C Hamano
* lt/revision-walker: Add "--show-all" revision walker flag for debugging
2008-02-21Merge branch 'mc/prefix'Junio C Hamano
* mc/prefix: Avoid a useless prefix lookup in strbuf_expand()
2008-02-21Merge branch 'bc/fopen'Junio C Hamano
* bc/fopen: Add compat/fopen.c which returns NULL on attempt to open directory
2008-02-21Merge branch 'jc/setup'Junio C Hamano
* jc/setup: builtin-mv: minimum fix to avoid losing files git-add: adjust to the get_pathspec() changes. Make blame accept absolute paths setup: sanitize absolute and funny paths in get_pathspec()
2008-02-21Merge branch 'maint'Junio C Hamano
* maint: Clarified the meaning of git-add -u in the documentation git-clone.sh: properly configure remote even if remote's head is dangling Documentation/git-stash: document options for git stash list send-email: squelch warning due to comparing undefined $_ to ""
2008-02-21Clarified the meaning of git-add -u in the documentationPekka Kaitaniemi
The git-add documentation did not state clearly that the -u switch updates only the tracked files that are in the current directory and its subdirectories. Signed-off-by: Pekka Kaitaniemi <kaitanie@cc.helsinki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20git-clone.sh: properly configure remote even if remote's head is danglingGerrit Pape
When cloning a remote repository which's HEAD refers to a nonexistent ref, git-clone cloned all existing refs, but failed to write the configuration for 'remote'. Now it detects the dangling remote HEAD, refuses to checkout any local branch since HEAD refers to nowhere, but properly writes the configuration for 'remote', so that subsequent 'git fetch's don't fail. The problem was reported by Daniel Jacobowitz through http://bugs.debian.org/466581 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20git.el: Set process-environment instead of invoking envDavid Kågedal
This will make it a little less posix-dependent, and more efficient. Included is also a minor doc improvement. Signed-off-by: David Kågedal <davidk@lysator.liu.se> Acked-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20Documentation/git-stash: document options for git stash listMiklos Vajna
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20send-email: squelch warning due to comparing undefined $_ to ""Jay Soffian
The check to see if initial_reply_to is defined was also comparing $_ to "" for a reason I cannot ascertain (looking at the commit which made the change didn't provide enlightenment), but if $_ is undefined, perl generates a warning. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20Merge branch 'maint'Junio C Hamano
* maint: Rename git-core rpm to just git and rename the meta-pacakge to git-all. push: document the status output Documentation/push: clarify matching refspec behavior push: indicate partialness of error message
2008-02-20cvsexportcommit: be graceful when "cvs status" reorders the argumentsJohannes Schindelin
In my use cases, "cvs status" sometimes reordered the passed filenames, which often led to a misdetection of a dirty state (when it was in reality a clean state). I finally tracked it down to two filenames having the same basename. So no longer trust the order of the results blindly, but actually check the file name. Since "cvs status" only returns the basename (and the complete path on the server which is useless for our purposes), run "cvs status" several times with lists consisting of files with unique (chomped) basenames. Be a bit clever about new files: these are reported as "no file <blabla>", so in order to discern it from existing files, prepend "no file " to the basename. In other words, one call to "cvs status" will not ask for two files "blabla" (which does not yet exist) and "no file blabla" (which exists). This patch makes cvsexportcommit slightly slower, when the list of changed files has non-unique basenames, but at least it is accurate now. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20Rename git-core rpm to just git and rename the meta-pacakge to git-all.Kristian Høgsberg
This fixes my favorite annoyance with the git rpm packaging: don't pull in tla when I say yum install git! You wouldn't expect yum install gcc to pull in gcc-gfortran, right? With this change, and blanket 'yum update' will automatically pull in the new 'git' package and push out the old 'git-core', and if the old 'git' package was installed 'git-all' will be pulled in instead. A couple of things do break though: 'yum update git-core', because yum behaves differently when given a specific package name - it doesn't follow obsoletes. Instead, 'yum install git' will pull in the new git rpm, which will then push out the old 'git-core'. Similarly, to get the newest version of the meta package, 'yum install git-all' will install git-all, which then pushes out the old 'git' meta package. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20Technical documentation of the run-command API.Johannes Sixt
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20Correct git-pull documentationJay Soffian
The --rebase option was documented in the wrong place (under MERGE STRATEGIES instead of OPTIONS). Noted the branch.<name>.rebase option. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20gitweb: Fix bug in href(..., -replay=>1) when using 'pathinfo' formJakub Narebski
URLs generated by href(..., -replay=>1) (which includes 'next page' links and alternate view links) didn't set project info correctly when current page URL is in pathinfo form. This resulted in broken links such like: http://www.example.com/w/ARRAY(0x85a5318)?a=shortlog;pg=1 if the 'pathinfo' feature was used, or http://www.example.com/w/?a=shortlog;pg=1 if it wasn't, instead of correct: http://www.example.com/w/project.git?a=shortlog;pg=1 This was caused by the fact that href() always replays params in the arrayref form, were they multivalued or singlevalued, and the code dealing with 'pathinfo' feature couldn't deal with $params{'project'} being arrayref. Setting $params{'project'} is moved before replaying params; this ensures that 'project' parameter is processed correctly. Noticed-by: Peter Oberndorfer <kumbayo84@arcor.de> Noticed-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20push: document the status outputJeff King
The output was meant to be a balance of self-explanatory and terse. In case we have erred too far on the terse side, it doesn't hurt to explain in more detail what each line means. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20Documentation/push: clarify matching refspec behaviorJeff King
The previous text was correct, but it was easy to miss the fact that we are talking about "matching" refs. That is, the text can be parsed as "we push the union of the sets of remote and local heads" and not "we push the intersection of the sets of remote and local heads". (The former actually doesn't make sense if you think about it, since we don't even _have_ some of those heads). A careful reading would reveal the correct meaning, but it makes sense to be as explicit as possible in documentation. We also explicitly use and introduce the term "matching"; this is a term discussed on the list, and it seems useful to for users to be able to refer to this behavior by name. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>