Code

git.git
16 years agogit-add -i: allow multiple selection in patch subcommand
Junio C Hamano [Thu, 22 Nov 2007 09:47:13 +0000 (01:47 -0800)]
git-add -i: allow multiple selection in patch subcommand

This allows more than one files from the list to be chosen from
the patch subcommand instead of going through the file one by
one.

This also updates the "list-and-choose" UI for usability.  When
the prompt ends with ">>", if you type '*' to choose all
choices, the prompt immediately returns the choice without
requiring an extra empty line to confirm the selection.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAddendum to "MaintNotes"
Junio C Hamano [Thu, 22 Nov 2007 11:08:39 +0000 (06:08 -0500)]
Addendum to "MaintNotes"

Add "how to maintain git" document. Foreward by Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit: Include the diff in the commit message when verbose.
Kristian Høgsberg [Thu, 22 Nov 2007 02:54:49 +0000 (21:54 -0500)]
builtin-commit: Include the diff in the commit message when verbose.

run_diff_index() and the entire diff machinery is hard coded to output
to stdout, so just redirect that and restore it when done.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit: fix partial-commit support
Junio C Hamano [Sun, 18 Nov 2007 09:52:55 +0000 (01:52 -0800)]
builtin-commit: fix partial-commit support

When making a partial-commit, we need to prepare two index
files, one to be used to write out the tree to be committed
(temporary index) and the other to be used as the index file
after the commit is made.

The temporary index needs to be initialized to HEAD and then all
the named paths on the command line need to be staged on top of
the index.  For this, running add_files_to_cache() that compares
what is in the index and the paths given from the command line
is not enough -- the comparison will miss the paths that the
user previously ran "git add" to the index since the HEAD
because the index reset to the HEAD would not know about them.
The index file needs to get the same modification done when
preparing the temporary index as described above.

This implementation mimics the behaviour of the scripted
version of git-commit.  It first runs overlay_tree_on_cache(),
which was stolen from ls-files with the earlier change, to get
the list of paths that the user can potentially mean, and then
uses pathspec_match() to find which ones the user meant.  This
list of paths is used to update both the temporary and the real
index file.

Additional fixes are:

 - read the index file after pre-commit hook returns, as the
   hook can modify it to affect the contents of the commit.

 - remove the temporary index file .git/next-index-* after
   commit is done or aborted.

 - run post-commit hook with the real index file to be used
   after the commit (previously it gave the temporary commit if
   a partial commit was made).

 - resurrect the safety mechanism to refuse partial commits
   during a merge to match the scripted version.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix add_files_to_cache() to take pathspec, not user specified list of files
Junio C Hamano [Sun, 18 Nov 2007 09:12:04 +0000 (01:12 -0800)]
Fix add_files_to_cache() to take pathspec, not user specified list of files

This separates the logic to limit the extent of change to the
index by where you are (controlled by "prefix") and what you
specify from the command line (controlled by "pathspec").

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoExport three helper functions from ls-files
Junio C Hamano [Sun, 18 Nov 2007 09:13:32 +0000 (01:13 -0800)]
Export three helper functions from ls-files

This exports three helper functions from ls-files.

 * pathspec_match() checks if a given path matches a set of pathspecs
   and optionally records which pathspec was used.  This function used
   to be called "match()" but renamed to be a bit less vague.

 * report_path_error() takes a set of pathspecs and the record
   pathspec_match() above leaves, and gives error message.  This
   was split out of the main function of ls-files.

 * overlay_tree_on_cache() takes a tree-ish (typically "HEAD")
   and overlays it on the current in-core index.  By iterating
   over the resulting index, the caller can find out the paths
   in either the index or the HEAD.  This function used to be
   called "overlay_tree()" but renamed to be a bit more
   descriptive.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit: run commit-msg hook with correct message file
Junio C Hamano [Sun, 18 Nov 2007 20:21:17 +0000 (12:21 -0800)]
builtin-commit: run commit-msg hook with correct message file

It should run with $GIT_DIR/COMMIT_EDITMSG, not just COMMIT_EDITMSG.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit: do not color status output shown in the message template
Junio C Hamano [Sun, 18 Nov 2007 20:01:38 +0000 (12:01 -0800)]
builtin-commit: do not color status output shown in the message template

Noticed by Ping Yin on the list.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofile_exists(): dangling symlinks do exist
Junio C Hamano [Sun, 18 Nov 2007 09:58:16 +0000 (01:58 -0800)]
file_exists(): dangling symlinks do exist

This function is used to see if a path given by the user does exist
on the filesystem.  A symbolic link that does not point anywhere does
exist but running stat() on it would yield an error, and it incorrectly
said it does not exist.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoReplace "runstatus" with "status" in the tests
Johannes Schindelin [Thu, 15 Nov 2007 06:27:57 +0000 (06:27 +0000)]
Replace "runstatus" with "status" in the tests

We no longer have "runstatus", but running "status" is no longer that
expensive anyway; it is a builtin.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot7501-commit: Add test for git commit <file> with dirty index.
Kristian Høgsberg [Thu, 15 Nov 2007 14:49:58 +0000 (09:49 -0500)]
t7501-commit: Add test for git commit <file> with dirty index.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit: Clean up an unused variable and a debug fprintf().
Kristian Høgsberg [Wed, 14 Nov 2007 15:31:53 +0000 (10:31 -0500)]
builtin-commit: Clean up an unused variable and a debug fprintf().

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoCall refresh_cache() when updating the user index for --only commits.
Kristian Høgsberg [Mon, 12 Nov 2007 20:48:22 +0000 (15:48 -0500)]
Call refresh_cache() when updating the user index for --only commits.

We're guaranteeing the user that the index will be stat-clean after
git commit. Thus, we need to call refresh_cache() for the user index too,
in the 'git commit <paths>' case.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit: Add newline when showing which commit was created
Johannes Schindelin [Sun, 11 Nov 2007 17:36:52 +0000 (17:36 +0000)]
builtin-commit: Add newline when showing which commit was created

The function log_tree_commit() does not break the line, so we have to
do it ourselves.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit: resurrect behavior for multiple -m options
Johannes Schindelin [Sun, 11 Nov 2007 17:36:39 +0000 (17:36 +0000)]
builtin-commit: resurrect behavior for multiple -m options

When more than one -m option is given, the message does not replace
the previous, but is appended as a new paragraph.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit --s: add a newline if the last line was not a S-o-b
Johannes Schindelin [Sun, 11 Nov 2007 17:36:27 +0000 (17:36 +0000)]
builtin-commit --s: add a newline if the last line was not a S-o-b

The rule is this: if the last line already contains the sign off by the
current committer, do nothing.  If it contains another sign off, just
add the sign off of the current committer.  If the last line does not
contain a sign off, add a new line before adding the sign off.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit: fix --signoff
Johannes Schindelin [Sun, 11 Nov 2007 17:35:58 +0000 (17:35 +0000)]
builtin-commit: fix --signoff

The Signed-off-by: line contained a spurious timestamp.  The reason was
a call to git_committer_info(1), which automatically added the
timestamp.

Instead, fmt_ident() was taught to interpret an empty string for the
date (as opposed to NULL, which still triggers the default behavior)
as "do not bother with the timestamp", and builtin-commit.c uses it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit status: show relative paths when run in a subdirectory
Johannes Schindelin [Sun, 11 Nov 2007 17:35:41 +0000 (17:35 +0000)]
git status: show relative paths when run in a subdirectory

To show the relative paths, the function formerly called quote_crlf()
(now called quote_path()) takes the prefix as an additional argument.

While at it, the static buffers were replaced by strbufs.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit: Refresh cache after adding files.
Kristian Høgsberg [Fri, 9 Nov 2007 16:40:27 +0000 (11:40 -0500)]
builtin-commit: Refresh cache after adding files.

We have promised our users that after running git-status or
git-commit the index will be refreshed for a long time since
these commands were introduced.  Do refresh the index before
writing it out to keep the promise.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-commit: fix reflog message generation
Johannes Schindelin [Thu, 8 Nov 2007 12:15:26 +0000 (12:15 +0000)]
builtin-commit: fix reflog message generation

Instead of strdup()ing, we can just reuse the buffer in which the
commit message is stored, and which is supposed to hold the reflog
message anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agolaunch_editor(): read the file, even when EDITOR=:
Johannes Schindelin [Thu, 8 Nov 2007 14:06:52 +0000 (14:06 +0000)]
launch_editor(): read the file, even when EDITOR=:

Earlier we just returned in case EDITOR=: but the message stored
in the file was not read back.  Fix this, at the same time
simplifying the code as suggested by Johannes Sixt.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoPort git commit to C.
Kristian Høgsberg [Thu, 8 Nov 2007 16:59:00 +0000 (11:59 -0500)]
Port git commit to C.

This makes git commit a builtin and moves git-commit.sh to
contrib/examples.  This also removes the git-runstatus
helper, which was mostly just a git-status.sh implementation detail.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoExport launch_editor() and make it accept ':' as a no-op editor.
Kristian Høgsberg [Fri, 2 Nov 2007 15:33:08 +0000 (11:33 -0400)]
Export launch_editor() and make it accept ':' as a no-op editor.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd testcase for amending and fixing author in git commit.
Kristian Høgsberg [Fri, 2 Nov 2007 15:33:06 +0000 (11:33 -0400)]
Add testcase for amending and fixing author in git commit.

We used to clobber author time, but we shouldn't.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake test scripts executable.
Junio C Hamano [Fri, 23 Nov 2007 00:52:17 +0000 (16:52 -0800)]
Make test scripts executable.

16 years agoMerge branch 'maint'
Junio C Hamano [Fri, 23 Nov 2007 00:51:18 +0000 (16:51 -0800)]
Merge branch 'maint'

* maint:
  Make test scripts executable.
  bundle create: keep symbolic refs' names instead of resolving them

16 years agoMake test scripts executable.
Junio C Hamano [Fri, 23 Nov 2007 00:48:55 +0000 (16:48 -0800)]
Make test scripts executable.

16 years agorebase -i: move help to end of todo file
Johannes Schindelin [Thu, 22 Nov 2007 12:30:10 +0000 (12:30 +0000)]
rebase -i: move help to end of todo file

[PATCH] rebase -i: move help to end of todo file

Many editors start in the first line, so the 9-line help text was an
annoyance.  So move it to the end.

Requested by Junio.

While at it, add a hint how to abort the rebase.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobundle create: keep symbolic refs' names instead of resolving them
Johannes Schindelin [Thu, 22 Nov 2007 12:24:59 +0000 (12:24 +0000)]
bundle create: keep symbolic refs' names instead of resolving them

When creating a bundle, symbolic refs used to be resolved to the
non-symbolic refs they point to before being written to the list
of contained refs.  I.e. "git bundle create a1.bundle HEAD master"
would show something like

388afe7881b33102fada216dd07806728773c011        refs/heads/master
388afe7881b33102fada216dd07806728773c011        refs/heads/master

instead of

388afe7881b33102fada216dd07806728773c011        HEAD
388afe7881b33102fada216dd07806728773c011        refs/heads/master

Introduce a special handling so that the symbolic refs are listed
with the names passed on the command line.

Noticed by Santi Béjar.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-merge-ours: make it a builtin.
Thomas Harning [Thu, 22 Nov 2007 20:19:40 +0000 (15:19 -0500)]
git-merge-ours: make it a builtin.

Except that this fixes a longstanding corner case bug by
tightening the way underlying diff-index command is run, it is
functionally equivalent to the scripted version.

Signed-off-by: Thomas Harning Jr <harningt@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: update it.po and glossary/it.po
Michele Ballabio [Thu, 22 Nov 2007 10:46:21 +0000 (11:46 +0100)]
git-gui: update it.po and glossary/it.po

Updates and fixes:
 * current -> attuale
 * failed -> impossibile/non riuscito
 * corrupt -> danneggiato

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: fix a typo in lib/commit.tcl
Michele Ballabio [Thu, 22 Nov 2007 15:20:08 +0000 (16:20 +0100)]
git-gui: fix a typo in lib/commit.tcl

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoAdd path-limiting to git-add--interactive
Wincent Colaiuta [Thu, 22 Nov 2007 01:36:24 +0000 (02:36 +0100)]
Add path-limiting to git-add--interactive

Implement Junio's suggestion that git-add--interactive should reproduce the
path-limiting semantics of non-interactive git-add.

In otherwords, if "git add -i" (unrestricted) shows paths from a set A,
"git add -i paths..." should show paths from a subset of the set A and that
subset should be defined with the existing ls-files pathspec semantics.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTeach builtin-add to pass multiple paths to git-add--interactive
Wincent Colaiuta [Thu, 22 Nov 2007 00:02:52 +0000 (01:02 +0100)]
Teach builtin-add to pass multiple paths to git-add--interactive

Instead of just accepting a single file parameter, git-add now accepts
any number of path parameters, fowarding them to git-add--interactive.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRefactor patch_update_cmd
Wincent Colaiuta [Wed, 21 Nov 2007 12:36:38 +0000 (13:36 +0100)]
Refactor patch_update_cmd

Split patch_update_cmd into two functions, one to prompt the user for
a path to patch and another to do the actual work given that file path.
This lays the groundwork for a future commit which will teach
git-add--interactive to accept a path parameter and jump directly to
the patch subcommand for that path, bypassing the interactive prompt.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAuthenticate only once in git-send-email
Wincent Colaiuta [Wed, 21 Nov 2007 12:35:05 +0000 (13:35 +0100)]
Authenticate only once in git-send-email

When using git-send-email with SMTP authentication sending a patch series
would redundantly authenticate multiple times, once for each patch. In
the worst case, this would actually prevent the series from being sent
because the server would reply with a "5.5.0 Already Authenticated"
status code which would derail the process.

This commit teaches git-send-email to authenticate once and only once at
the beginning of the series.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Thu, 22 Nov 2007 08:34:49 +0000 (00:34 -0800)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: allow `info' command to work offline
  git-svn: info --url [path]
  git-svn info: implement info command
  git-svn: extract reusable code into utility functions
  t9106: fix a race condition that caused svn to miss modifications

16 years agoFix "quote" misconversion for rewrite diff output.
Junio C Hamano [Thu, 22 Nov 2007 07:06:44 +0000 (23:06 -0800)]
Fix "quote" misconversion for rewrite diff output.

663af3422a648e87945e4d8c0cc3e13671f2bbde (Full rework of
quote_c_style and write_name_quoted.) mistakenly used puts()
when writing out a fixed string when it did not want to add a
terminating LF.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: allow `info' command to work offline
Eric Wong [Thu, 22 Nov 2007 02:20:57 +0000 (18:20 -0800)]
git-svn: allow `info' command to work offline

Cache the repository root whenever we connect to the repository.
This will allow us to notice URL changes if the user changes the
URL in .git/config, too.

If the repository is no longer accessible, or if `git svn info'
is the first and only command run; then '(offline)' will be
displayed for "Repository Root:" in the output.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn: info --url [path]
David D. Kilzer [Wed, 21 Nov 2007 19:57:19 +0000 (11:57 -0800)]
git-svn: info --url [path]

Return the svn URL for the given path, or return the svn
repository URL if no path is given.

Added 18 tests to t/t9119-git-svn-info.sh.

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn info: implement info command
David D. Kilzer [Wed, 21 Nov 2007 19:57:18 +0000 (11:57 -0800)]
git-svn info: implement info command

Implement "git-svn info" for files and directories based on the
"svn info" command.  Note that the -r/--revision argument is not
supported yet.

Added 18 tests in t/t9119-git-svn-info.sh.

[ew: small fix to work without arguments on all working directories]

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn: extract reusable code into utility functions
David D. Kilzer [Wed, 21 Nov 2007 06:43:17 +0000 (22:43 -0800)]
git-svn: extract reusable code into utility functions

Extacted canonicalize_path() in the main package.

Created new Git::SVN::Util package with an md5sum() function.  A
new package was created so that Digest::MD5 did not have to be
loaded in the main package.  Replaced code in the SVN::Git::Editor
and SVN::Git::Fetcher packages with calls to md5sum().

Extracted the format_svn_date(), parse_git_date() and
set_local_timezone() functions within the Git::SVN::Log package.

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agot9106: fix a race condition that caused svn to miss modifications
Eric Wong [Wed, 21 Nov 2007 08:57:33 +0000 (00:57 -0800)]
t9106: fix a race condition that caused svn to miss modifications

carbonated beverage noticed this test was occasionally failing.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
16 years agoMerge git://repo.or.cz/git-gui
Junio C Hamano [Wed, 21 Nov 2007 08:00:56 +0000 (00:00 -0800)]
Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui: (96 commits)
  git-gui 0.9.0
  git-gui: Bind Meta-T for "Stage To Commit" menu action
  git-gui: Allow users to set font weights to bold
  git-gui: Update Japanese strings (part 2)
  git-gui: Update Japanese strings
  Updated russian translation of git-gui
  po2msg: actually output statistics
  po2msg: ignore untranslated messages
  po2msg: ignore entries marked with "fuzzy"
  git-gui: Protect against bad translation strings
  git-gui: Make sure we get errors from git-update-index
  More updates and corrections to the russian translation of git-gui
  Updated Russian translation.
  git-gui: Update German translation
  git-gui: Add more terms to glossary.
  git-gui: Paper bag fix the global config parsing
  git-gui: Honor a config.mak in git-gui's top level
  git-gui: Collapse $env(HOME) to ~/ in recent repositories on Windows
  git-gui: Support cloning Cygwin based work-dirs
  git-gui: Use proper Windows shortcuts instead of bat files
  ...

16 years agogit-p4: Fix typo in --detect-labels
Shun Kei Leung [Wed, 21 Nov 2007 03:01:19 +0000 (11:01 +0800)]
git-p4: Fix typo in --detect-labels

Signed-off-by: Kevin Leung <kevinlsk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosend-pack: cluster ref status reporting
Jeff King [Tue, 20 Nov 2007 11:18:01 +0000 (06:18 -0500)]
send-pack: cluster ref status reporting

Instead of intermingling success and failure, we now print:

  1. all uptodate refs (if args.verbose is enabled)
  2. successfully pushed refs
  3. failed refs

with the assumption that the user is most likely to see the
ones at the end, and therefore we order them from "least
interesting" to "most interesting."

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoavoid "defined but not used" warning for fetch_objs_via_walker
Jeff King [Sun, 18 Nov 2007 08:17:23 +0000 (03:17 -0500)]
avoid "defined but not used" warning for fetch_objs_via_walker

Because this function is static and used only by the
http-walker, when NO_CURL is defined, gcc emits a "defined
but not used" warning.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui 0.9.0 gitgui-0.9.0
Shawn O. Pearce [Wed, 21 Nov 2007 07:10:03 +0000 (02:10 -0500)]
git-gui 0.9.0

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 21 Nov 2007 07:00:07 +0000 (23:00 -0800)]
Merge branch 'maint'

* maint:
  send-email: add transfer encoding header with content-type
  Doc fix for git-reflog: mention @{...} syntax, and <ref> in synopsys.
  config: clarify compression defaults
  config: correct core.loosecompression documentation

16 years agosend-email: add transfer encoding header with content-type
Jeff King [Tue, 20 Nov 2007 12:54:04 +0000 (07:54 -0500)]
send-email: add transfer encoding header with content-type

We add the content-type header only when we have non-7bit
characters from the 'From' header, so we really need to
specify the encoding (in other cases, where the commit text
needed a content-type, git-format-patch will already have
added the encoding header).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-compat-util.h: auto-adjust to compiler support of FLEX_ARRAY a bit better
Junio C Hamano [Tue, 20 Nov 2007 20:08:06 +0000 (12:08 -0800)]
git-compat-util.h: auto-adjust to compiler support of FLEX_ARRAY a bit better

When declaring a structure with a flexible array member, instead
of defaulting to the c99 syntax for non-gnu compilers (which
burned people with older compilers), default to the traditional
and more portable "member[1]; /* more */" syntax.

At the same time, other c99 compilers should be able to take
advantage of the modern syntax to flexible array members without
being gcc.  Check __STDC_VERSION__ for that.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFlush progress message buffer in display().
Johannes Sixt [Mon, 19 Nov 2007 19:48:58 +0000 (20:48 +0100)]
Flush progress message buffer in display().

This will make progress display from pack-objects (invoked via
upload-pack) more responsive on platforms with an implementation
of stdio whose stderr is line buffered.

The standard error stream is defined to be merely "not fully
buffered"; this is different from "unbuffered".  If the
implementation of the stdio library chooses to make it line
buffered, progress reports that end with CR but do not contain
LF will accumulate in the stdio buffer before written out.  A
fflush() after each progress display gives a nice continuous
progress.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoautoconf: Add tests for memmem, strtoumax and mkdtemp functions
Jakub Narebski [Mon, 19 Nov 2007 18:47:05 +0000 (19:47 +0100)]
autoconf: Add tests for memmem, strtoumax and mkdtemp functions

Update configure.ac (and config.mak.in) to keep up with git
development by adding tests for memmem (NO_MEMMEM), strtoumax
(NO_STRTOUMAX) and mkdtemp (NO_MKDTEMP) functions.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitweb: Put project README in div.readme, fix its padding
Jakub Narebski [Mon, 19 Nov 2007 13:16:12 +0000 (14:16 +0100)]
gitweb: Put project README in div.readme, fix its padding

Put (optional) projects README on "summary" page in <div> element
using "readme" class.  This allow to style it using CSS.

Add padding to project's README to make it line out with the rest
of the page.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
16 years agogitweb: Style all tables using CSS
Jakub Narebski [Mon, 19 Nov 2007 13:16:11 +0000 (14:16 +0100)]
gitweb: Style all tables using CSS

Remove all cellspacing="0" attributes from tables in gitweb,
replacing it by CSS rule.  Add CSS classes for all tables.

While at it, change class(es) of table for commit message and commit
authorship search from "grep" to "commit_search"; similarly,
"grep_search" class is now used for table with results of grep (files)
search.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
16 years agosend-email: Don't add To: recipients to the Cc: header
Ask Bjørn Hansen [Mon, 19 Nov 2007 11:00:26 +0000 (03:00 -0800)]
send-email: Don't add To: recipients to the Cc: header

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoBisect reset: do nothing when not bisecting.
Christian Couder [Tue, 20 Nov 2007 05:39:53 +0000 (06:39 +0100)]
Bisect reset: do nothing when not bisecting.

Before this patch, using "git bisect reset" when not bisecting
did a "git checkout master" for no good reason.

This also happened using "git bisect replay" when not bisecting
because "bisect_replay" starts by calling "bisect_reset".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDoc fix for git-reflog: mention @{...} syntax, and <ref> in synopsys.
Matthieu Moy [Mon, 19 Nov 2007 18:25:11 +0000 (19:25 +0100)]
Doc fix for git-reflog: mention @{...} syntax, and <ref> in synopsys.

The HEAD@{...} syntax was documented in git-rev-parse manpage, which
is hard to find by someone looking for the documentation of porcelain.
git-reflog is probably the place where one expects to find this.

While I'm there, "git revlog show whatever" was also undocumented.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoconfig: clarify compression defaults
Brian Downing [Mon, 19 Nov 2007 16:58:51 +0000 (10:58 -0600)]
config: clarify compression defaults

* Clarify that core.compression provides a system-wide default to
  other compression parameters.

* Explain that the default for pack.compression, -1, is "a default
  compromise between speed and compression (currently equivalent
  to level 6)" according to zlib.h.

Signed-off-by: Brian Downing <bdowning@lavos.net>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoconfig: correct core.loosecompression documentation
Brian Downing [Mon, 19 Nov 2007 16:58:50 +0000 (10:58 -0600)]
config: correct core.loosecompression documentation

* core.loosecompression stated that the default was "0 (best speed)",
  when in fact 0 is "no compression", and the default is Z_BEST_SPEED,
  which is 1.

Signed-off-by: Brian Downing <bdowning@lavos.net>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitview: import only one of gtksourceview and gtksourceview2
Anton Gyllenberg [Mon, 19 Nov 2007 10:37:16 +0000 (12:37 +0200)]
gitview: import only one of gtksourceview and gtksourceview2

Importing both gtksourceview and gtksourceview2 will make python segfault
on my system (ubuntu 7.10). Change so that gtksourceview is only imported
if importing gtksourceview2 fails. This should be safe as gtksourceview
is only used if gtksourceview2 is not available.

Signed-off-by: Anton Gyllenberg <anton@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-send-email: show all headers when sending mail
David D. Kilzer [Mon, 19 Nov 2007 04:14:55 +0000 (20:14 -0800)]
git-send-email: show all headers when sending mail

As a git newbie, it was confusing to set an In-Reply-To header but then
not see it printed when the git-send-email command was run.

This patch prints all headers that would be sent to sendmail or an SMTP
server instead of only printing From, Subject, Cc, To.  It also removes
the now-extraneous Date header after the "Log says" line.

Added test to t/t9001-send-email.sh.

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Mon, 19 Nov 2007 08:19:15 +0000 (00:19 -0800)]
Merge branch 'maint'

* maint:
  Documentation: Fix references to deprecated commands
  user-manual: mention "..." in "Generating diffs", etc.
  user-manual: Add section "Why bisecting merge commits can be harder ..."
  git-remote.txt: fix example url

16 years agoFurther clarify clean.requireForce changes
Wincent Colaiuta [Mon, 19 Nov 2007 08:06:31 +0000 (09:06 +0100)]
Further clarify clean.requireForce changes

Mention the -f switch in the release notes for clean.requireForce to avoid
possible misunderstandings.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint' of git://linux-nfs.org/~bfields/git into maint
Junio C Hamano [Mon, 19 Nov 2007 07:56:01 +0000 (23:56 -0800)]
Merge branch 'maint' of git://linux-nfs.org/~bfields/git into maint

* 'maint' of git://linux-nfs.org/~bfields/git:
  Documentation: Fix references to deprecated commands
  user-manual: mention "..." in "Generating diffs", etc.
  user-manual: Add section "Why bisecting merge commits can be harder ..."
  git-remote.txt: fix example url

16 years agoMake builtin-tag.c use parse_options.
Carlos Rica [Fri, 9 Nov 2007 13:42:56 +0000 (14:42 +0100)]
Make builtin-tag.c use parse_options.

Also, this removes those tests ensuring that repeated
-m options don't allocate memory more than once, because now
this is done after parsing options, using the last one
when more are given. The same for -F.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTeach git clean to use setup_standard_excludes()
Shawn Bohrer [Thu, 15 Nov 2007 05:00:54 +0000 (23:00 -0600)]
Teach git clean to use setup_standard_excludes()

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-clean: Fix error message if clean.requireForce is not set.
Junio C Hamano [Tue, 13 Nov 2007 05:13:05 +0000 (21:13 -0800)]
git-clean: Fix error message if clean.requireForce is not set.

It was distracting to see this error message:

     clean.requireForce set and -n or -f not given; refusing to clean

even though clean.requireForce was not set at all. This patch distinguishes
the cases and gives a different message depending on whether the
configuration variable is not set or set to true.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake git-clean a builtin
Shawn Bohrer [Mon, 12 Nov 2007 01:48:47 +0000 (19:48 -0600)]
Make git-clean a builtin

This replaces git-clean.sh with builtin-clean.c, and moves
git-clean.sh to the examples.

This also introduces a change in behavior when removing directories
explicitly specified as a path.  For example currently:

1. When dir has only untracked files, these two behave differently:

    $ git clean -n dir
    $ git clean -n dir/

the former says "Would not remove dir/", while the latter would say
"Would remove dir/untracked" for all paths under it, but not the
directory itself.

With -d, the former would stop refusing, however since the user
explicitly asked to remove the directory the -d is no longer required.

2. When there are more parameters:

    $ git clean -n dir foo
    $ git clean -n dir/ foo

both cases refuse to remove dir/ unless -d is specified.  Once again
since both cases requested to remove dir the -d is no longer required.

Thanks to Johannes Schindelin for the conversion to using the
parse-options API.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMove gitk to its own subdirectory
Junio C Hamano [Sat, 17 Nov 2007 18:51:16 +0000 (10:51 -0800)]
Move gitk to its own subdirectory

This is to prepare for gitk i18n effort that makes gitk not a single file
project anymore.  We may use subproject to bind git.git and gitk.git more
loosely in the future, but we do not want to require everybody to have
subproject aware git to be able to pull from git.git yet.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorefactor fetch's ref matching to use refname_match()
Steffen Prohaska [Sun, 11 Nov 2007 14:01:48 +0000 (15:01 +0100)]
refactor fetch's ref matching to use refname_match()

The old rules used by fetch were coded as a series of ifs.  The old
rules are:
1) match full refname if it starts with "refs/" or matches "HEAD"
2) verify that full refname starts with "refs/"
3) match abbreviated name in "refs/" if it starts with "heads/",
    "tags/", or "remotes/".
4) match abbreviated name in "refs/heads/"

This is replaced by the new rules
a) match full refname
b) match abbreviated name prefixed with "refs/"
c) match abbreviated name prefixed with "refs/heads/"

The details of the new rules are different from the old rules.  We no
longer verify that the full refname starts with "refs/".  The new rule
(a) matches any full string.  The old rules (1) and (2) were stricter.
Now, the caller is responsible for using sensible full refnames.  This
should be the case for the current code.  The new rule (b) is less
strict than old rule (3).  The new rule accepts abbreviated names that
start with a non-standard prefix below "refs/".

Despite this modifications the new rules should handle all cases as
expected.  Two tests are added to verify that fetch does not resolve
short tags or HEAD in remotes.

We may even think about loosening the rules a bit more and unify them
with the rev-parse rules.  This would be done by replacing
ref_ref_fetch_rules with ref_ref_parse_rules.  Note, the two new test
would break.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopush: use same rules as git-rev-parse to resolve refspecs
Steffen Prohaska [Sun, 11 Nov 2007 14:01:47 +0000 (15:01 +0100)]
push: use same rules as git-rev-parse to resolve refspecs

This commit changes the rules for resolving refspecs to match the
rules for resolving refs in rev-parse. git-rev-parse uses clear rules
to resolve a short ref to its full name, which are well documented.
The rules for resolving refspecs documented in git-send-pack were
less strict and harder to understand. This commit replaces them by
the rules of git-rev-parse.

The unified rules are easier to understand and better resolve ambiguous
cases. You can now push from a repository containing several branches
ending on the same short name.

Note, this may break existing setups. For example, "master" will no longer
resolve to "origin/master" even when there is no other "master" elsewhere.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoadd refname_match()
Steffen Prohaska [Sun, 11 Nov 2007 14:01:46 +0000 (15:01 +0100)]
add refname_match()

We use at least two rulesets for matching abbreviated refnames with
full refnames (starting with 'refs/').  git-rev-parse and git-fetch
use slightly different rules.

This commit introduces a new function refname_match
(const char *abbrev_name, const char *full_name, const char **rules).

abbrev_name is expanded using the rules and matched against full_name.
If a match is found the function returns true.  rules is a NULL-terminate
list of format patterns with "%.*s", for example:

    const char *ref_rev_parse_rules[] = {
               "%.*s",
               "refs/%.*s",
               "refs/tags/%.*s",
               "refs/heads/%.*s",
               "refs/remotes/%.*s",
               "refs/remotes/%.*s/HEAD",
               NULL
    };

Asterisks are included in the format strings because this is the form
required in sha1_name.c.  Sharing the list with the functions there is
a good idea to avoid duplicating the rules.  Hopefully this
facilitates unified matching rules in the future.

This commit makes the rules used by rev-parse for resolving refs to
sha1s available for string comparison.  Before this change, the rules
were buried in get_sha1*() and dwim_ref().

A follow-up commit will refactor the rules used by fetch.

refname_match() will be used for matching refspecs in git-send-pack.

Thanks to Daniel Barkalow <barkalow@iabervon.org> for pointing
out that ref_matches_abbrev in remote.c solves a similar problem
and care should be taken to avoid confusion.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopush: support pushing HEAD to real branch name
Steffen Prohaska [Sun, 11 Nov 2007 14:35:07 +0000 (15:35 +0100)]
push: support pushing HEAD to real branch name

This teaches "push <remote> HEAD" to resolve HEAD on the local
side to its real branch name, e.g. master, and then act as if
the real branch name was specified. So we have a shorthand for
pushing the current branch. Besides HEAD, no other symbolic ref
is resolved.

Thanks to Daniel Barkalow <barkalow@iabervon.org> for suggesting
this implementation, which is much simpler than the
implementation proposed before.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: Fix references to deprecated commands
J. Bruce Fields [Mon, 19 Nov 2007 01:50:57 +0000 (20:50 -0500)]
Documentation: Fix references to deprecated commands

... by changing git-tar-tree reference to git-archive and removing
seemingly unrelevant footnote about git-ssh-{fetch,upload}.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agoBisect: use "$GIT_DIR/BISECT_NAMES" to check if we are bisecting.
Christian Couder [Sun, 18 Nov 2007 15:34:03 +0000 (16:34 +0100)]
Bisect: use "$GIT_DIR/BISECT_NAMES" to check if we are bisecting.

Previously we tested if the "$GIT_DIR/refs/bisect" directory
existed, to check if we were bisecting.

Now with packed refs, it is simpler to check if the file
"$GIT_DIR/BISECT_NAMES" exists, as it is already created when
starting bisection and removed when reseting bisection.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUpdate draft release notes for 1.5.4
Junio C Hamano [Mon, 19 Nov 2007 00:24:14 +0000 (16:24 -0800)]
Update draft release notes for 1.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agouser-manual: mention "..." in "Generating diffs", etc.
J. Bruce Fields [Mon, 19 Nov 2007 00:18:27 +0000 (19:18 -0500)]
user-manual: mention "..." in "Generating diffs", etc.

We should mention the use of the "..." syntax for git-diff here.  The
note about the difference between diff and the combined output of
git-format-patch then no longer fits so well, so remove it.  Add a
reference to the git-format-patch[1] manpage.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agoMerge branch 'lt/rev-list-gitlink'
Junio C Hamano [Mon, 19 Nov 2007 00:16:37 +0000 (16:16 -0800)]
Merge branch 'lt/rev-list-gitlink'

* lt/rev-list-gitlink:
  Fix rev-list when showing objects involving submodules

16 years agoMerge branch 'ds/checkout-upper'
Junio C Hamano [Mon, 19 Nov 2007 00:04:17 +0000 (16:04 -0800)]
Merge branch 'ds/checkout-upper'

* ds/checkout-upper:
  git-checkout: Test for relative path use.
  git-checkout: Support relative paths containing "..".

16 years agoMerge branch 'sh/p4'
Junio C Hamano [Mon, 19 Nov 2007 00:03:58 +0000 (16:03 -0800)]
Merge branch 'sh/p4'

* sh/p4:
  git-p4: Fix direct import from perforce after fetching changes through git from origin

16 years agoMerge branch 'lt/rev-list-interactive'
Junio C Hamano [Mon, 19 Nov 2007 00:03:24 +0000 (16:03 -0800)]
Merge branch 'lt/rev-list-interactive'

* lt/rev-list-interactive:
  Fix parent rewriting in --early-output
  revision walker: mini clean-up
  Enhance --early-output format
  Add "--early-output" log flag for interactive GUI use
  Simplify topo-sort logic

16 years agoMerge branch 'ph/diffopts'
Junio C Hamano [Sun, 18 Nov 2007 23:50:16 +0000 (15:50 -0800)]
Merge branch 'ph/diffopts'

* ph/diffopts:
  Reorder diff_opt_parse options more logically per topics.
  Make the diff_options bitfields be an unsigned with explicit masks.
  Use OPT_BIT in builtin-pack-refs
  Use OPT_BIT in builtin-for-each-ref
  Use OPT_SET_INT and OPT_BIT in builtin-branch
  parse-options new features.

16 years agoDraft release notes: fix clean.requireForce description
Junio C Hamano [Sun, 18 Nov 2007 23:22:51 +0000 (15:22 -0800)]
Draft release notes: fix clean.requireForce description

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint' to synchronize with 1.5.3.6
Junio C Hamano [Sun, 18 Nov 2007 23:15:47 +0000 (15:15 -0800)]
Merge branch 'maint' to synchronize with 1.5.3.6

* maint:
  GIT 1.5.3.6
  grep -An -Bm: fix invocation of external grep command

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agouser-manual: Add section "Why bisecting merge commits can be harder ..."
Steffen Prohaska [Sat, 10 Nov 2007 13:49:54 +0000 (14:49 +0100)]
user-manual: Add section "Why bisecting merge commits can be harder ..."

This commit adds a discussion of the challenge of bisecting
merge commits to the user manual.  The original author is
Junio C Hamano <gitster@pobox.com>, who posted the text to
the mailing list <http://marc.info/?l=git&m=119403257315527&w=2>.
His email was adapted for the manual.

The discussion is added to "Rewriting history and maintainig
patch series".  The text added requires good understanding of
merging and rebasing.  Therefore it should not be placed too
early in the manual.  Right after the section on "Problems with
rewriting history", the discussion of bisect gives another reason
for linearizing as much of the history as possible.

The text includes suggestions and fixes by
Ralf Wildenhues <Ralf.Wildenhues@gmx.de> and
Benoit Sigoure <tsuna@lrde.epita.fr>.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agoGIT 1.5.3.6 v1.5.3.6
Junio C Hamano [Sun, 18 Nov 2007 22:00:38 +0000 (14:00 -0800)]
GIT 1.5.3.6

16 years agoUse compat mkdtemp() on Solaris boxes
Guido Ostkamp [Fri, 16 Nov 2007 18:59:58 +0000 (19:59 +0100)]
Use compat mkdtemp() on Solaris boxes

Define NO_MKDTEMP for all variants of SunOS; Solaris 10 does not
have mkdtemp() and all the other versions our Makefile knows
about don't have it either.

NO_{SETENV,UNSETENV,C99_FORMAT,STRTOUMAX} definitions cannot be
unified across versions.  Beginning with Solaris 10, the C-library
provides unsetenv(), setenv() and strtoumax().  Also 'z'/'t' formats
are supported.  However, older versions of Solaris do not support
these.

Signed-off-by: Guido Ostkamp <git@ostkamp.fastmail.fm>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosend-pack: fix "everything up-to-date" message
Jeff King [Sun, 18 Nov 2007 08:08:22 +0000 (03:08 -0500)]
send-pack: fix "everything up-to-date" message

This has always been slightly inaccurate, since it used the
new_refs counter, which really meant "did we send any
objects," so deletions were not counted.

It has gotten even worse with recent patches, since we no
longer look at the 'ret' value, meaning we would say "up to
date" if non-ff pushes were rejected.

Instead, we now claim up to date iff every ref is either
unmatched or up to date. Any other case should already have
generated a status line.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosend-pack: tighten remote error reporting
Jeff King [Sun, 18 Nov 2007 07:16:52 +0000 (02:16 -0500)]
send-pack: tighten remote error reporting

Previously, we set all ref pushes to 'OK', and then marked
them as errors if the remote reported so. This has the
problem that if the remote dies or fails to report a ref, we
just assume it was OK.

Instead, we use a new non-OK state to indicate that we are
expecting status (if the remote doesn't support the
report-status feature, we fall back on the old behavior).
Thus we can flag refs for which we expected a status, but
got none (conversely, we now also print a warning for refs
for which we get a status, but weren't expecting one).

This also allows us to simplify the receive_status exit
code, since each ref is individually marked with failure
until we get a success response. We can just print the usual
status table, so the user still gets a sense of what we were
trying to do when the failure happened.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agomake "find_ref_by_name" a public function
Jeff King [Sun, 18 Nov 2007 07:13:10 +0000 (02:13 -0500)]
make "find_ref_by_name" a public function

This was a static in remote.c, but is generally useful.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix warning about bitfield in struct ref
Shawn O. Pearce [Sun, 18 Nov 2007 09:31:37 +0000 (04:31 -0500)]
Fix warning about bitfield in struct ref

cache.h:503: warning: type of bit-field 'force' is a GCC extension
cache.h:504: warning: type of bit-field 'merge' is a GCC extension
cache.h:505: warning: type of bit-field 'nonfastforward' is a GCC extension
cache.h:506: warning: type of bit-field 'deletion' is a GCC extension

So we change it to an 'unsigned int' which is not a GCC extension.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'ph/parseopt-sh'
Junio C Hamano [Sun, 18 Nov 2007 05:39:37 +0000 (21:39 -0800)]
Merge branch 'ph/parseopt-sh'

* ph/parseopt-sh:
  git-quiltimport.sh fix --patches handling
  git-am: -i does not take a string parameter.
  sh-setup: don't let eval output to be shell-expanded.
  git-sh-setup: fix parseopt `eval` string underquoting
  Give git-am back the ability to add Signed-off-by lines.
  git-rev-parse --parseopt
  scripts: Add placeholders for OPTIONS_SPEC
  Migrate git-repack.sh to use git-rev-parse --parseopt
  Migrate git-quiltimport.sh to use git-rev-parse --parseopt
  Migrate git-checkout.sh to use git-rev-parse --parseopt --keep-dashdash
  Migrate git-instaweb.sh to use git-rev-parse --parseopt
  Migrate git-merge.sh to use git-rev-parse --parseopt
  Migrate git-am.sh to use git-rev-parse --parseopt
  Migrate git-clone to use git-rev-parse --parseopt
  Migrate git-clean.sh to use git-rev-parse --parseopt.
  Update git-sh-setup(1) to allow transparent use of git-rev-parse --parseopt
  Add a parseopt mode to git-rev-parse to bring parse-options to shell scripts.

16 years agogrep -An -Bm: fix invocation of external grep command
Junio C Hamano [Sun, 18 Nov 2007 05:18:14 +0000 (21:18 -0800)]
grep -An -Bm: fix invocation of external grep command

When building command line to invoke external grep, the
arguments to -A/-B/-C options were placd in randarg[] buffer,
but the code forgot that snprintf() does not count terminating
NUL in its return value.  This caused "git grep -A1 -B2" to
invoke external grep with "-B21 -A1".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofetch-pack: Prepare for a side-band demultiplexer in a thread.
Johannes Sixt [Sat, 17 Nov 2007 22:09:28 +0000 (23:09 +0100)]
fetch-pack: Prepare for a side-band demultiplexer in a thread.

get_pack() receives a pair of file descriptors that communicate with
upload-pack at the remote end. In order to support the case where the
side-band demultiplexer runs in a thread, and, hence, in the same process
as the main routine, we must not close the readable file descriptor early.

The handling of the readable fd is changed in the case where upload-pack
supports side-band communication: The old code closed the fd after it was
inherited to the side-band demultiplexer process. Now we do not close it.
The caller (do_fetch_pack) will close it later anyway. The demultiplexer
is the only reader, it does not matter that the fd remains open in the
main process as well as in unpack-objects/index-pack, which inherits it.

The writable fd is not needed in get_pack(), hence, the old code closed
the fd. For symmetry with the readable fd, we now do not close it; the
caller (do_fetch_pack) will close it later anyway. Therefore, the new
behavior is that the channel now remains open during the entire
conversation, but this has no ill effects because upload-pack does not read
from it once it has begun to send the pack data. For the same reason it
does not matter that the writable fd is now inherited to the demultiplexer
and unpack-objects/index-pack processes.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-remote.txt: fix example url
J. Bruce Fields [Sat, 3 Nov 2007 02:54:31 +0000 (22:54 -0400)]
git-remote.txt: fix example url

If I'm going to use a real example as a URL, I suppose I should get it
right....

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Sun, 18 Nov 2007 00:40:03 +0000 (16:40 -0800)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: Fix a typo and add a comma in an error message in git-svn
  git-svn log: handle unreachable revisions like "svn log"
  git-svn log: include commit log for the smallest revision in a range
  git-svn log: fix ascending revision ranges
  git-svn's dcommit must use subversion's config
  git-svn: add tests for command-line usage of init and clone commands

16 years agogit-svn: Fix a typo and add a comma in an error message in git-svn
David Reiss [Tue, 13 Nov 2007 21:47:26 +0000 (13:47 -0800)]
git-svn: Fix a typo and add a comma in an error message in git-svn

Signed-off-by: David Reiss <dreiss@facebook.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn log: handle unreachable revisions like "svn log"
David D Kilzer [Mon, 12 Nov 2007 06:56:52 +0000 (22:56 -0800)]
git-svn log: handle unreachable revisions like "svn log"

When unreachable revisions are given to "svn log", it displays all commit
logs in the given range that exist in the current tree.  (If no commit
logs are found in the current tree, it simply prints a single commit log
separator.)  This patch makes "git-svn log" behave the same way.

Ten tests added to t/t9116-git-svn-log.sh.

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agogit-svn log: include commit log for the smallest revision in a range
David D Kilzer [Sun, 11 Nov 2007 06:10:34 +0000 (22:10 -0800)]
git-svn log: include commit log for the smallest revision in a range

The "svn log -rM:N" command shows commit logs inclusive in the range [M,N].
Previously "git-svn log" always excluded the commit log for the smallest
revision in a range, whether the range was ascending or descending.  With
this patch, the smallest revision in a range is always shown.

Updated tests for ascending and descending revision ranges.

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>