git.git
18 years agoSync with 1.5.4.3
Junio C Hamano [Sat, 23 Feb 2008 19:49:34 +0000 (11:49 -0800)]
Sync with 1.5.4.3

Signed-off-by: Junio C Hamano <redacted>
18 years agoGIT 1.5.4.3
Junio C Hamano [Sat, 23 Feb 2008 19:31:04 +0000 (11:31 -0800)]
GIT 1.5.4.3

Signed-off-by: Junio C Hamano <redacted>
18 years agoMerge branch 'maint' of git://repo.or.cz/git-gui into maint
Junio C Hamano [Sat, 23 Feb 2008 19:23:59 +0000 (11:23 -0800)]
Merge branch 'maint' of git://repo.or.cz/git-gui into maint

* '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

18 years agoAdd merge-subtree back
Junio C Hamano [Sat, 23 Feb 2008 19:08:25 +0000 (11:08 -0800)]
Add merge-subtree back

An earlier commit e1b3a2c (Build-in merge-recursive) made the
subtree merge strategy backend unavailable.  This resurrects
it.

A new test t6029 currently only tests the strategy is available,
but it should be enhanced to check the real "subtree" case.

Signed-off-by: Junio C Hamano <redacted>
18 years agogit-stash: add new 'pop' subcommand
Brandon Casey [Fri, 22 Feb 2008 22:52:50 +0000 (16:52 -0600)]
git-stash: add new 'pop' subcommand

This combines the existing stash subcommands 'apply' and 'drop' to
allow a single stash entry to be applied and then dropped, in other
words 'popped', from the stash list.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogit-stash: add new 'drop' subcommand
Brandon Casey [Fri, 22 Feb 2008 19:04:54 +0000 (13:04 -0600)]
git-stash: add new 'drop' subcommand

This allows a single stash entry to be deleted. It takes an
optional argument which is a stash reflog entry. If no
arguments are supplied, it drops the most recent stash entry.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogit-reflog: add option --updateref to write the last reflog sha1 into the ref
Brandon Casey [Fri, 22 Feb 2008 19:04:12 +0000 (13:04 -0600)]
git-reflog: add option --updateref to write the last reflog sha1 into the ref

Certain sanity checks on the reflog assume that the sha1 of the top reflog
entry will be equal to the sha1 stored in the ref.

When reflog entries are deleted, this assumption may not hold. This patch
adds a new option to git-reflog which causes the subcommands "expire" and
"delete" to update the ref with the sha1 of the top-most reflog entry.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agorefs.c: make close_ref() and commit_ref() non-static
Brandon Casey [Fri, 22 Feb 2008 18:57:30 +0000 (12:57 -0600)]
refs.c: make close_ref() and commit_ref() non-static

This is in preparation to the reflog-expire changes which will
allow updating the ref after expiring the reflog.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogit-reflog: add option --rewrite to update reflog entries while expiring
Brandon Casey [Fri, 22 Feb 2008 18:56:50 +0000 (12:56 -0600)]
git-reflog: add option --rewrite to update reflog entries while expiring

Certain sanity checks on the reflog assume that each entry will contain
a reference to the previous entry. i.e. that the "old" sha1 field of a
reflog entry will be equal to the "new" sha1 field of the previous entry.

When reflog entries are deleted, this assumption may not hold. This patch
adds a new option to git-reflog which causes the subcommands "expire" and
"delete" to rewrite the "old" sha1 field of each reflog entry so that it
points to the previous reflog entry.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoreflog-delete: parse standard reflog options
Brandon Casey [Fri, 22 Feb 2008 21:08:59 +0000 (15:08 -0600)]
reflog-delete: parse standard reflog options

Add support for some standard reflog options such as --dry-run and
--verbose to the reflog delete subcommand.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoMerge branch 'bc/reflog-fix' into js/reflog-delete
Junio C Hamano [Sat, 23 Feb 2008 06:54:37 +0000 (22:54 -0800)]
Merge branch 'bc/reflog-fix' into js/reflog-delete

* bc/reflog-fix: (1490 commits)
  builtin-reflog.c: don't install new reflog on write failure
  hash: fix lookup_hash semantics
  gitweb: Better chopping in commit search results
  builtin-tag.c: remove cruft
  git-merge-index documentation: clarify synopsis
  send-email: fix In-Reply-To regression
  git-reset --hard and git-read-tree --reset: fix read_cache_unmerged()
  Teach git-grep --name-only as synonym for -l
  diff: fix java funcname pattern for solaris
  t3404: use configured shell instead of /bin/sh
  git_config_*: don't assume we are parsing a config file
  prefix_path: use is_absolute_path() instead of *orig == '/'
  git-clean: handle errors if removing files fails
  Clarified the meaning of git-add -u in the documentation
  git-clone.sh: properly configure remote even if remote's head is dangling
  git.el: Set process-environment instead of invoking env
  Documentation/git-stash: document options for git stash list
  send-email: squelch warning due to comparing undefined $_ to ""
  cvsexportcommit: be graceful when "cvs status" reorders the arguments
  Rename git-core rpm to just git and rename the meta-pacakge to git-all.
  ...

Conflicts:

Documentation/git-reflog.txt
t/t1410-reflog.sh

18 years agobuiltin-reflog.c: don't install new reflog on write failure
Brandon Casey [Fri, 22 Feb 2008 18:47:08 +0000 (12:47 -0600)]
builtin-reflog.c: don't install new reflog on write failure

When expiring reflog entries, a new temporary log is written which contains
only the entries to retain. After it is written, it is renamed to replace
the existing reflog. Currently, we check that writing of the new log is
successful and print a message on failure, but the original reflog is still
replaced with the new reflog even on failure. This patch causes the
original reflog to be retained if we fail when writing the new reflog.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agopull: pass --strategy along to to rebase
Jay Soffian [Sat, 23 Feb 2008 00:52:29 +0000 (19:52 -0500)]
pull: pass --strategy along to to rebase

rebase supports --strategy, so pull should pass the option along to it.

Signed-off-by: Jay Soffian <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoUse helper function for copying index entry information
Linus Torvalds [Sat, 23 Feb 2008 04:41:17 +0000 (20:41 -0800)]
Use helper function for copying index entry information

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoName hash fixups: export (and rename) remove_hash_entry
Linus Torvalds [Sat, 23 Feb 2008 04:39:21 +0000 (20:39 -0800)]
Name hash fixups: export (and rename) remove_hash_entry

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoFix name re-hashing semantics
Linus Torvalds [Sat, 23 Feb 2008 04:37:40 +0000 (20:37 -0800)]
Fix name re-hashing semantics

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoAvoid unnecessary "if-before-free" tests.
Jim Meyering [Thu, 31 Jan 2008 17:26:32 +0000 (18:26 +0100)]
Avoid unnecessary "if-before-free" tests.

This change removes all obvious useless if-before-free tests.
E.g., it replaces code like this:

        if (some_expression)
                free (some_expression);

with the now-equivalent:

        free (some_expression);

It is equivalent not just because POSIX has required free(NULL)
to work for a long time, but simply because it has worked for
so long that no reasonable porting target fails the test.
Here's some evidence from nearly 1.5 years ago:

    http://www.winehq.org/pipermail/wine-patches/2006-October/031544.html

FYI, the change below was prepared by running the following:

  git ls-files -z | xargs -0 \
  perl -0x3b -pi -e \
    's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+(free\s*\(\s*\1\s*\))/$2/s'

Note however, that it doesn't handle brace-enclosed blocks like
"if (x) { free (x); }".  But that's ok, since there were none like
that in git sources.

Beware: if you do use the above snippet, note that it can
produce syntactically invalid C code.  That happens when the
affected "if"-statement has a matching "else".
E.g., it would transform this

  if (x)
    free (x);
  else
    foo ();

into this:

  free (x);
  else
    foo ();

There were none of those here, either.

If you're interested in automating detection of the useless
tests, you might like the useless-if-before-free script in gnulib:
[it *does* detect brace-enclosed free statements, and has a --name=S
 option to make it detect free-like functions with different names]

  http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=build-aux/useless-if-before-free

Addendum:
  Remove one more (in imap-send.c), spotted by Jean-Luc Herren <redacted>.

Signed-off-by: Jim Meyering <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoMerge branch 'maint'
Junio C Hamano [Fri, 22 Feb 2008 22:01:43 +0000 (14:01 -0800)]
Merge branch 'maint'

* maint:
  hash: fix lookup_hash semantics

18 years agohash: fix lookup_hash semantics
Jeff King [Fri, 22 Feb 2008 19:47:27 +0000 (14:47 -0500)]
hash: fix lookup_hash semantics

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogitweb: Better chopping in commit search results
Junio C Hamano [Fri, 22 Feb 2008 16:33:47 +0000 (17:33 +0100)]
gitweb: Better chopping in commit search results

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agohash-object: cleanup handling of command line options
Gerrit Pape [Thu, 21 Feb 2008 10:06:47 +0000 (10:06 +0000)]
hash-object: cleanup handling of command line options

git hash-object used to process the --stdin command line argument
before reading subsequent arguments.  This caused 'git hash-object
--stdin -w' to fail to actually write the object into the
database, while '-w --stdin' properly did.  Now git hash-object
first reads all arguments, and then processes them.

This regresses one insane use case.  git hash-object used to allow
multiple --stdin arguments on the command line:

   $ git hash-object --stdin --stdin
     foo
     ^D
     bar
     ^D

Now git hash-object errors out if --stdin is given more than once.

Reported by Josh Triplett through
 http://bugs.debian.org/464432

Signed-off-by: Gerrit Pape <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agobuiltin-tag.c: remove cruft
Gerrit Pape [Fri, 22 Feb 2008 09:53:09 +0000 (09:53 +0000)]
builtin-tag.c: remove cruft

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogit-merge-index documentation: clarify synopsis
Gerrit Pape [Fri, 22 Feb 2008 08:55:29 +0000 (08:55 +0000)]
git-merge-index documentation: clarify synopsis

The options following <merge-program> are not -a, --, or <file>...,
but either -a, or -- <file>..., while -- is optional.

Signed-off-by: Gerrit Pape <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoMerge branch 'maint'
Shawn O. Pearce [Fri, 22 Feb 2008 06:40:25 +0000 (01:40 -0500)]
Merge branch 'maint'

* maint:
  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

18 years agogit-gui: Focus insertion point at end of strings in repository chooser
Shawn O. Pearce [Mon, 11 Feb 2008 05:53:52 +0000 (00:53 -0500)]
git-gui: Focus insertion point at end of strings in repository chooser

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 <redacted>
18 years agogit-gui: Avoid hardcoded Windows paths in Cygwin package files
Shawn O. Pearce [Fri, 22 Feb 2008 00:27:46 +0000 (19:27 -0500)]
git-gui: Avoid hardcoded Windows paths in Cygwin package files

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 <redacted>
18 years agogit-gui: Default TCL_PATH to same location as TCLTK_PATH
Shawn O. Pearce [Fri, 22 Feb 2008 00:17:27 +0000 (19:17 -0500)]
git-gui: Default TCL_PATH to same location as TCLTK_PATH

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 <redacted>
18 years agogit-gui: Paper bag fix error dialogs opening over the main window
Shawn O. Pearce [Thu, 21 Feb 2008 17:22:08 +0000 (12:22 -0500)]
git-gui: Paper bag fix error dialogs opening over the main window

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 <redacted>
18 years agogit-gui: fix typo in lib/spellcheck.tcl
Michele Ballabio [Thu, 21 Feb 2008 14:38:56 +0000 (15:38 +0100)]
git-gui: fix typo in lib/spellcheck.tcl

Signed-off-by: Michele Ballabio <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
18 years agosend-email: fix In-Reply-To regression
Jay Soffian [Fri, 22 Feb 2008 00:16:04 +0000 (19:16 -0500)]
send-email: fix In-Reply-To regression

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agocheckout: updates to tracking report
Junio C Hamano [Thu, 21 Feb 2008 03:42:53 +0000 (19:42 -0800)]
checkout: updates to tracking report

Ask branch_get() for the new branch explicitly instead of
letting it return a potentially stale information.

Tighten the logic to find the tracking branch to deal better
with misconfigured repositories (i.e. branch.*.merge can exist
but it may not have a refspec that fetches to .it)

Also fixes grammar in a message, as pointed out by Jeff King.

The function is about reporting and not automatically
fast-forwarding to the upstream, so stop calling it
"adjust-to".

Signed-off-by: Junio C Hamano <redacted>
Acked-by: Daniel Barkalow <redacted>
18 years agobuiltin-checkout.c: Remove unused prefix arguments in switch_branches path
Daniel Barkalow [Thu, 21 Feb 2008 15:50:42 +0000 (10:50 -0500)]
builtin-checkout.c: Remove unused prefix arguments in switch_branches path

This path doesn't actually care where in the tree you started out,
since it must change the whole thing anyway. With the gratuitous bug
removed, the argument is unused.

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogit-reset --hard and git-read-tree --reset: fix read_cache_unmerged()
Junio C Hamano [Thu, 21 Feb 2008 19:33:56 +0000 (11:33 -0800)]
git-reset --hard and git-read-tree --reset: fix read_cache_unmerged()

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogit-gui: Shorten Aspell version strings to just Aspell version number
Shawn O. Pearce [Thu, 21 Feb 2008 05:20:50 +0000 (00:20 -0500)]
git-gui: Shorten Aspell version strings to just Aspell version number

We really only support Aspell, so showing the compatibility line from
ispell is of little value to end users.

Signed-off-by: Shawn O. Pearce <redacted>
18 years agogit-gui: Gracefully display non-aspell version errors to users
Shawn O. Pearce [Thu, 21 Feb 2008 05:17:18 +0000 (00:17 -0500)]
git-gui: Gracefully display non-aspell version errors to users

If the user has somehow managed to make us execute ispell instead
of aspell, even though our code is invoking aspell, and ispell is
not recognizing the aspell command line options we use to invoke
it then we don't want a giant usage message back from ispell.

Instead we show the ispell version number, letting the user know
we don't actually support that spell checker.

Signed-off-by: Shawn O. Pearce <redacted>
18 years agogit-gui: Catch and display aspell startup failures to the user
Shawn O. Pearce [Thu, 21 Feb 2008 03:34:11 +0000 (22:34 -0500)]
git-gui: Catch and display aspell startup failures to the user

If we feed a bad dictionary name to aspell on startup it may appear
to start (as Tcl found the executable in our $PATH) but it fails to
give us the version string.  In such a case the close of the pipe
will report the exit status of the process (failure) and that is
an error in Tcl.

We now trap the subprocess failure and display the stderr message
from it, letting the user know why the failure is happening.  We then
disable the spell checker, but keep our object instance so the user
can alter their preferred dictionary through the options dialog, and
possibly restart the spell checker.

I was also originally wrong to use "error" here for the display
of the problem to the user.  I meant to use "error_popup", which
will open a message box and show the failure in a GUI context,
rather than killing git-gui and showing the message on the console.

Noticed by Ilari on #git.

Signed-off-by: Shawn O. Pearce <redacted>
18 years agogit-gui: Only bind the spellcheck popup suggestion hook once
Shawn O. Pearce [Thu, 21 Feb 2008 02:55:43 +0000 (21:55 -0500)]
git-gui: Only bind the spellcheck popup suggestion hook once

If we reconnect to the spellchecker there is no reason to resetup
the binding for button 3 on our text widget to show the suggestion
list (if available).

Plus, by moving it out of _connect and into init we can now break
out of _connect earlier if there is something wrong with the pipe,
for example if the dictionary we were asked to load is not valid.

Signed-off-by: Shawn O. Pearce <redacted>
18 years agogit-gui: Remove explicit references to 'aspell' in message strings
Shawn O. Pearce [Thu, 21 Feb 2008 02:52:54 +0000 (21:52 -0500)]
git-gui: Remove explicit references to 'aspell' in message strings

Users may or may not be using aspell here.  About the only thing
we are using that is aspell specific (and not supported by ispell
or an ispell variant) is some command line options when we start
up aspell, and a forced encoding of UTF-8.  Both of these can be
corrected and/or cleaned up by users through an aspell wrapper
script, or through further improvements to git-gui.  There is no
reason to require our translated strings to reference a specific
spell checker, especially if that spell checker implementation is
not very suitable for the language being translated.

Signed-off-by: Shawn O. Pearce <redacted>
18 years agogit-gui: Ensure all spellchecker 'class' variables are initialized
Shawn O. Pearce [Thu, 21 Feb 2008 02:48:21 +0000 (21:48 -0500)]
git-gui: Ensure all spellchecker 'class' variables are initialized

If we somehow managed to get our spellchecker instance created but
aspell wasn't startable we may not finish _connect and thus may
find one or more of our fields was not initialized in the instance.

If we have an instance but no version, there is no reason to show
a version to the user in our about dialog.  We effectively have no
spellchecker available.

Signed-off-by: Shawn O. Pearce <redacted>
18 years agoMerge branch 'maint'
Shawn O. Pearce [Thu, 21 Feb 2008 05:21:54 +0000 (00:21 -0500)]
Merge branch 'maint'

* maint:
  git-gui: Ensure error dialogs always appear over all other windows

18 years agogit-gui: Ensure error dialogs always appear over all other windows
Shawn O. Pearce [Thu, 21 Feb 2008 04:37:07 +0000 (23:37 -0500)]
git-gui: Ensure error dialogs always appear over all other windows

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 <redacted>
18 years agoTeach git-grep --name-only as synonym for -l
Shawn O. Pearce [Thu, 21 Feb 2008 04:28:07 +0000 (23:28 -0500)]
Teach git-grep --name-only as synonym for -l

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agodiff: fix java funcname pattern for solaris
Jeff King [Thu, 21 Feb 2008 00:01:16 +0000 (19:01 -0500)]
diff: fix java funcname pattern for solaris

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agot3404: use configured shell instead of /bin/sh
Jeff King [Thu, 21 Feb 2008 00:00:44 +0000 (19:00 -0500)]
t3404: use configured shell instead of /bin/sh

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogit_config_*: don't assume we are parsing a config file
Jeff King [Thu, 21 Feb 2008 00:00:32 +0000 (19:00 -0500)]
git_config_*: don't assume we are parsing a config file

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoprefix_path: use is_absolute_path() instead of *orig == '/'
Johannes Sixt [Tue, 19 Feb 2008 21:29:40 +0000 (22:29 +0100)]
prefix_path: use is_absolute_path() instead of *orig == '/'

Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogit-clean: handle errors if removing files fails
Miklos Vajna [Thu, 21 Feb 2008 01:44:46 +0000 (02:44 +0100)]
git-clean: handle errors if removing files fails

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoMerge branch 'mk/color'
Junio C Hamano [Thu, 21 Feb 2008 00:13:56 +0000 (16:13 -0800)]
Merge branch 'mk/color'

* mk/color:
  Add color.ui variable which globally enables colorization if set

18 years agoMerge branch 'js/maint-cvsexport'
Junio C Hamano [Thu, 21 Feb 2008 00:13:52 +0000 (16:13 -0800)]
Merge branch 'js/maint-cvsexport'

* js/maint-cvsexport:
  cvsexportcommit: be graceful when "cvs status" reorders the arguments

Conflicts:

t/t9200-git-cvsexportcommit.sh

18 years agoMerge branch 'js/maint-http-push'
Junio C Hamano [Thu, 21 Feb 2008 00:13:32 +0000 (16:13 -0800)]
Merge branch 'js/maint-http-push'

* js/maint-http-push:
  http-push: avoid a needless goto
  http-push: do not get confused by submodules
  http-push: avoid invalid memory accesses

18 years agoMerge branch 'jk/empty-tree'
Junio C Hamano [Thu, 21 Feb 2008 00:13:28 +0000 (16:13 -0800)]
Merge branch 'jk/empty-tree'

* jk/empty-tree:
  add--interactive: handle initial commit better
  hard-code the empty tree object

18 years agoMerge branch 'lt/revision-walker'
Junio C Hamano [Thu, 21 Feb 2008 00:13:24 +0000 (16:13 -0800)]
Merge branch 'lt/revision-walker'

* lt/revision-walker:
  Add "--show-all" revision walker flag for debugging

18 years agoMerge branch 'mc/prefix'
Junio C Hamano [Thu, 21 Feb 2008 00:13:22 +0000 (16:13 -0800)]
Merge branch 'mc/prefix'

* mc/prefix:
  Avoid a useless prefix lookup in strbuf_expand()

18 years agoMerge branch 'bc/fopen'
Junio C Hamano [Thu, 21 Feb 2008 00:13:19 +0000 (16:13 -0800)]
Merge branch 'bc/fopen'

* bc/fopen:
  Add compat/fopen.c which returns NULL on attempt to open directory

18 years agoMerge branch 'jc/setup'
Junio C Hamano [Thu, 21 Feb 2008 00:13:16 +0000 (16:13 -0800)]
Merge branch 'jc/setup'

* 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()

18 years agoMerge branch 'maint'
Junio C Hamano [Thu, 21 Feb 2008 00:13:13 +0000 (16:13 -0800)]
Merge branch 'maint'

* 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 ""

18 years agoClarified the meaning of git-add -u in the documentation
Pekka Kaitaniemi [Wed, 20 Feb 2008 22:29:39 +0000 (00:29 +0200)]
Clarified the meaning of git-add -u in the documentation

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agocheckout: work from a subdirectory
Junio C Hamano [Wed, 20 Feb 2008 23:54:54 +0000 (15:54 -0800)]
checkout: work from a subdirectory

When switching branches from a subdirectory, checkout rewritten
in C extracted the toplevel of the tree in there.

This should fix it.

Signed-off-by: Junio C Hamano <redacted>
18 years agocheckout: tone down the "forked status" diagnostic messages
Junio C Hamano [Wed, 20 Feb 2008 23:05:23 +0000 (15:05 -0800)]
checkout: tone down the "forked status" diagnostic messages

When checking out a branch that is behind or forked from a
branch you are building on top of, we used to show full
left-right log but if you already _know_ you have long history
since you forked, it is a bit too much.

This tones down the message quite a bit, by only showing the
number of commits each side has since they diverged.  Also the
message is not shown at all under --quiet.

Signed-off-by: Junio C Hamano <redacted>
18 years agogit-clone.sh: properly configure remote even if remote's head is dangling
Gerrit Pape [Wed, 20 Feb 2008 15:10:17 +0000 (15:10 +0000)]
git-clone.sh: properly configure remote even if remote's head is dangling

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogit.el: Set process-environment instead of invoking env
David Kågedal [Tue, 19 Feb 2008 14:01:53 +0000 (15:01 +0100)]
git.el: Set process-environment instead of invoking env

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 <redacted>
Acked-by: Alexandre Julliard <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoDocumentation/git-stash: document options for git stash list
Miklos Vajna [Wed, 20 Feb 2008 11:31:35 +0000 (12:31 +0100)]
Documentation/git-stash: document options for git stash list

Signed-off-by: Miklos Vajna <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoResolve value supplied for no-colon push refspecs
Daniel Barkalow [Wed, 20 Feb 2008 17:54:05 +0000 (12:54 -0500)]
Resolve value supplied for no-colon push refspecs

When pushing a refspec like "HEAD", we used to treat it as
"HEAD:HEAD", which didn't work without rewriting. Instead, we should
resolve the ref. If it's a symref, further require it to point to a
branch, to avoid doing anything especially unexpected. Also remove the
rewriting previously added in builtin-push.

Since the code for "HEAD" uses the regular refspec parsing, it
automatically handles "+HEAD" without anything special.

[jc: added a further test to make sure that "remote.*.push = HEAD" works]

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agosend-email: squelch warning due to comparing undefined $_ to ""
Jay Soffian [Wed, 20 Feb 2008 05:55:07 +0000 (00:55 -0500)]
send-email: squelch warning due to comparing undefined $_ to ""

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoMerge branch 'maint'
Junio C Hamano [Wed, 20 Feb 2008 08:54:24 +0000 (00:54 -0800)]
Merge branch 'maint'

* 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

18 years agocvsexportcommit: be graceful when "cvs status" reorders the arguments
Johannes Schindelin [Mon, 18 Feb 2008 17:55:22 +0000 (17:55 +0000)]
cvsexportcommit: be graceful when "cvs status" reorders the arguments

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoRename git-core rpm to just git and rename the meta-pacakge to git-all.
Kristian Høgsberg [Mon, 18 Feb 2008 23:11:21 +0000 (18:11 -0500)]
Rename git-core rpm to just git and rename the meta-pacakge to git-all.

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoSupport a --cc=<email> option in format-patch
Daniel Barkalow [Tue, 19 Feb 2008 07:40:35 +0000 (02:40 -0500)]
Support a --cc=<email> option in format-patch

When you have particular reviewers you want to sent particular series
to, it's nice to be able to generate the whole series with them as
additional recipients, without configuring them into your general
headers or adding them by hand afterwards.

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoCombine To: and Cc: headers
Daniel Barkalow [Tue, 19 Feb 2008 07:40:33 +0000 (02:40 -0500)]
Combine To: and Cc: headers

RFC 2822 only permits a single To: header and a single Cc: header, so
we need to turn multiple values of each of these into a list. This
will be particularly significant with a command-line option to add Cc:
headers, where the user can't make sure to configure valid header sets
in any easy way.

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoFix format.headers not ending with a newline
Daniel Barkalow [Tue, 19 Feb 2008 07:40:31 +0000 (02:40 -0500)]
Fix format.headers not ending with a newline

Now each value of format.headers will always be treated as a single
valid header, and newlines will be inserted between them as needed.

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoAdd tests for extra headers in format-patch
Daniel Barkalow [Tue, 19 Feb 2008 07:40:28 +0000 (02:40 -0500)]
Add tests for extra headers in format-patch

Presently, it works with each header ending with a newline, but not
without the newlines.

Also add a test to see that multiple "To:" headers get combined.

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoAdd a --cover-letter option to format-patch
Daniel Barkalow [Tue, 19 Feb 2008 03:56:13 +0000 (22:56 -0500)]
Add a --cover-letter option to format-patch

If --cover-letter is provided, generate a cover letter message before
the patches, numbered 0.

Original patch thanks to Johannes Schindelin

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoMerge branch 'maint'
Shawn O. Pearce [Wed, 20 Feb 2008 05:40:13 +0000 (00:40 -0500)]
Merge branch 'maint'

* maint:
  git-gui: relax "dirty" version detection

18 years agoTechnical documentation of the run-command API.
Johannes Sixt [Mon, 18 Feb 2008 19:23:03 +0000 (20:23 +0100)]
Technical documentation of the run-command API.

Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoCorrect git-pull documentation
Jay Soffian [Tue, 19 Feb 2008 19:24:32 +0000 (14:24 -0500)]
Correct git-pull documentation

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogitweb: Fix bug in href(..., -replay=>1) when using 'pathinfo' form
Jakub Narebski [Thu, 14 Feb 2008 08:22:30 +0000 (09:22 +0100)]
gitweb: Fix bug in href(..., -replay=>1) when using 'pathinfo' form

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 <redacted>
Noticed-by: Wincent Colaiuta <redacted>
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agodoc: documentation update for the branch track changes
Jay Soffian [Tue, 19 Feb 2008 16:24:38 +0000 (11:24 -0500)]
doc: documentation update for the branch track changes

Documents the branch.autosetupmerge=always setting and usage of --track
when branching from a local branch.

Signed-off-by: Jay Soffian <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agobranch: optionally setup branch.*.merge from upstream local branches
Jay Soffian [Tue, 19 Feb 2008 16:24:37 +0000 (11:24 -0500)]
branch: optionally setup branch.*.merge from upstream local branches

"git branch" and "git checkout -b" now honor --track option even when
the upstream branch is local.  Previously --track was silently ignored
when forking from a local branch.  Also the command did not error out
when --track was explicitly asked for but the forked point specified
was not an existing branch (i.e. when there is no way to set up the
tracking configuration), but now it correctly does.

The configuration setting branch.autosetupmerge can now be set to
"always", which is equivalent to using --track from the command line.
Setting branch.autosetupmerge to "true" will retain the former behavior
of only setting up branch.*.merge for remote upstream branches.

Includes test cases for the new functionality.

Signed-off-by: Jay Soffian <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agopush: document the status output
Jeff King [Tue, 19 Feb 2008 16:26:45 +0000 (11:26 -0500)]
push: document the status output

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoDocumentation/push: clarify matching refspec behavior
Jeff King [Tue, 19 Feb 2008 16:25:22 +0000 (11:25 -0500)]
Documentation/push: clarify matching refspec behavior

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agopush: indicate partialness of error message
Jeff King [Tue, 19 Feb 2008 16:25:01 +0000 (11:25 -0500)]
push: indicate partialness of error message

The existing message indicates that an error occured during
push, but it is unclear whether _any_ refs were actually
pushed (even though the status table above shows which were
pushed successfully and which were not, the message "failed
to push" implies a total failure). By indicating that "some
refs" failed, we hopefully indicate to the user that the
table above contains the details.

We could also put in an explicit "see above for details"
message, but it seemed to clutter the output quite a bit
(both on a line of its own, or at the end of the error line,
which inevitably wraps).

This could also be made more fancy if the transport
mechanism passed back more details on how many refs
succeeded and failed:

  error: failed to push %d out of %d refs to '%s'

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agogit-gui: relax "dirty" version detection
Wincent Colaiuta [Mon, 18 Feb 2008 08:36:33 +0000 (09:36 +0100)]
git-gui: relax "dirty" version detection

"git gui" would complain at launch if the local version of Git was
"1.5.4.2.dirty". Loosen the regular expression to look for either
"-dirty" or ".dirty", thus eliminating spurious warnings.

Signed-off-by: Wincent Colaiuta <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
18 years agoUse ALLOC_GROW in remote.{c,h}
Daniel Barkalow [Tue, 19 Feb 2008 04:41:41 +0000 (23:41 -0500)]
Use ALLOC_GROW in remote.{c,h}

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoExport some email and pretty-printing functions
Daniel Barkalow [Tue, 19 Feb 2008 03:56:08 +0000 (22:56 -0500)]
Export some email and pretty-printing functions

These will be used for generating the cover letter in addition to the
patch emails.

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoImprove message-id generation flow control for format-patch
Daniel Barkalow [Tue, 19 Feb 2008 03:56:06 +0000 (22:56 -0500)]
Improve message-id generation flow control for format-patch

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoAdd more tests for format-patch
Daniel Barkalow [Tue, 19 Feb 2008 03:56:02 +0000 (22:56 -0500)]
Add more tests for format-patch

Tests -o, and an excessively long subject, and --thread, with and
without --in-reply-to=

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoAPI documentation for remote.h
Daniel Barkalow [Tue, 19 Feb 2008 07:52:11 +0000 (02:52 -0500)]
API documentation for remote.h

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoClean up reporting differences on branch switch
Daniel Barkalow [Tue, 19 Feb 2008 07:52:14 +0000 (02:52 -0500)]
Clean up reporting differences on branch switch

This also changes it such that:

$ git checkout

will give the same information without changing branches. This is good
for finding out if the fetch you did recently had anything to say
about the branch you've been on, whose name you don't remember at the
moment.

Signed-off-by: Daniel Barkalow <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoSimplify setup of $GIT_DIR in git-sh-setup.sh
Lars Hjemli [Mon, 18 Feb 2008 10:44:19 +0000 (11:44 +0100)]
Simplify setup of $GIT_DIR in git-sh-setup.sh

Using 'git rev-parse --git-dir' makes the code shorter and more future-
proof.

Signed-off-by: Lars Hjemli <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoMerge branch 'mk/maint-parse-careful'
Junio C Hamano [Tue, 19 Feb 2008 04:56:01 +0000 (20:56 -0800)]
Merge branch 'mk/maint-parse-careful'

* mk/maint-parse-careful:
  peel_onion: handle NULL
  check return value from parse_commit() in various functions
  parse_commit: don't fail, if object is NULL
  revision.c: handle tag->tagged == NULL
  reachable.c::process_tree/blob: check for NULL
  process_tag: handle tag->tagged == NULL
  check results of parse_commit in merge_bases
  list-objects.c::process_tree/blob: check for NULL
  reachable.c::add_one_tree: handle NULL from lookup_tree
  mark_blob/tree_uninteresting: check for NULL
  get_sha1_oneline: check return value of parse_object
  read_object_with_reference: don't read beyond the buffer

18 years agopeel_onion: handle NULL
Martin Koegler [Mon, 18 Feb 2008 20:47:58 +0000 (21:47 +0100)]
peel_onion: handle NULL

Signed-off-by: Martin Koegler <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agocheck return value from parse_commit() in various functions
Martin Koegler [Mon, 18 Feb 2008 20:48:03 +0000 (21:48 +0100)]
check return value from parse_commit() in various functions

Signed-off-by: Martin Koegler <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoparse_commit: don't fail, if object is NULL
Martin Koegler [Mon, 18 Feb 2008 20:48:02 +0000 (21:48 +0100)]
parse_commit: don't fail, if object is NULL

Some codepaths (eg. builtin-rev-parse -> get_merge_bases -> parse_commit)
can pass NULL.

Signed-off-by: Martin Koegler <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agorevision.c: handle tag->tagged == NULL
Martin Koegler [Mon, 18 Feb 2008 20:48:01 +0000 (21:48 +0100)]
revision.c: handle tag->tagged == NULL

Signed-off-by: Martin Koegler <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoreachable.c::process_tree/blob: check for NULL
Martin Koegler [Mon, 18 Feb 2008 20:48:00 +0000 (21:48 +0100)]
reachable.c::process_tree/blob: check for NULL

As these functions are directly called with the result
from lookup_tree/blob, they must handle NULL.

Signed-off-by: Martin Koegler <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoprocess_tag: handle tag->tagged == NULL
Martin Koegler [Mon, 18 Feb 2008 20:47:59 +0000 (21:47 +0100)]
process_tag: handle tag->tagged == NULL

Signed-off-by: Martin Koegler <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agocheck results of parse_commit in merge_bases
Martin Koegler [Mon, 18 Feb 2008 20:47:57 +0000 (21:47 +0100)]
check results of parse_commit in merge_bases

An error is signaled by returning NULL.

Signed-off-by: Martin Koegler <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agolist-objects.c::process_tree/blob: check for NULL
Martin Koegler [Mon, 18 Feb 2008 20:47:56 +0000 (21:47 +0100)]
list-objects.c::process_tree/blob: check for NULL

As these functions are directly called with the result
from lookup_tree/blob, they must handle NULL.

Signed-off-by: Martin Koegler <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agoreachable.c::add_one_tree: handle NULL from lookup_tree
Martin Koegler [Mon, 18 Feb 2008 20:47:55 +0000 (21:47 +0100)]
reachable.c::add_one_tree: handle NULL from lookup_tree

Signed-off-by: Martin Koegler <redacted>
Signed-off-by: Junio C Hamano <redacted>
18 years agomark_blob/tree_uninteresting: check for NULL
Martin Koegler [Mon, 18 Feb 2008 20:47:54 +0000 (21:47 +0100)]
mark_blob/tree_uninteresting: check for NULL

As these functions are directly called with the result
from lookup_tree/blob, they must handle NULL.

Signed-off-by: Martin Koegler <redacted>
Signed-off-by: Junio C Hamano <redacted>
git clone https://git.99rst.org/PROJECT