Commit Graph

25670 Commits

Author SHA1 Message Date
Junio C Hamano
f574cb3404 Merge branch 'maint'
* maint:
  Update draft release notes to 1.7.5.2
  git_open_noatime(): drop unused parameter
  sha1_file: typofix
2011-05-15 16:16:56 -07:00
Junio C Hamano
96dbe93da5 Update draft release notes to 1.7.5.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-15 16:11:55 -07:00
Junio C Hamano
06c0f42f94 Merge branch 'cn/format-patch-quiet' into maint
* cn/format-patch-quiet:
  format-patch: document --quiet option
  format-patch: don't pass on the --quiet flag
2011-05-15 16:10:49 -07:00
Junio C Hamano
ab02095ccd Merge branch 'jm/mergetool-submodules' into maint
* jm/mergetool-submodules:
  mergetool: Teach about submodules
2011-05-15 15:57:16 -07:00
Junio C Hamano
92b501f2a0 Merge branch 'jk/format-patch-quote-special-in-from' into maint
* jk/format-patch-quote-special-in-from:
  pretty: quote rfc822 specials in email addresses
2011-05-15 15:56:44 -07:00
Junio C Hamano
e5c1650b27 Merge branch 'vh/git-svn-doc' into maint
* vh/git-svn-doc:
  git-svn.txt: small typeface improvements
  git-svn.txt: move option descriptions
  git-svn.txt: fix usage of --add-author-from
2011-05-15 15:52:40 -07:00
Junio C Hamano
f4e516834e git_open_noatime(): drop unused parameter
Since commit c793430 (Limit file descriptors used by packs, 2011-02-28),
the extra parameter added in f2e872aa (Work around EMFILE when there are
too many pack files, 2010-11-01) is not used anymore.

Remove it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
2011-05-15 15:24:52 -07:00
Junio C Hamano
ccf5ace0dc sha1_file: typofix
The number zero is spelled "zero", not "zer0".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-15 15:24:36 -07:00
Junio C Hamano
5bf29b9500 read_sha1_file(): allow selective bypassing of replacement mechanism
The way "object replacement" mechanism was tucked to the read_sha1_file()
interface was suboptimal in a couple of ways:

 - Callers that want it to die with useful diagnosis upon seeing a corrupt
   object does not have a way to say that they do not want any object
   replacement.

 - Callers who do not want it to die but want to handle the errors
   themselves are told to arrange to call read_object(), but the function
   does not use the replacement mechanism, and also it is a file scope
   static function that not many callers can call to begin with.

This adds a read_sha1_file_extended() that takes a set of flags; the
callers of read_sha1_file() passes a flag READ_SHA1_FILE_REPLACE to ask
for object replacement mechanism to kick in.

Later, we could add another flag bit to tell the function to return an
error instead of dying and then remove the misguided "call read_object()
yourself".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-15 15:23:34 -07:00
Junio C Hamano
e1111cef23 inline lookup_replace_object() calls
In a repository without object replacement, lookup_replace_object() should
be a no-op. Check the flag "read_replace_refs" on the side of the caller,
and bypess a function call when we know we are not dealing with replacement.

Also, even when we are set up to replace objects, if we do not find any
replacement defined, flip that flag off to avoid function call overhead
for all the later object accesses.

As this change the semantics of the flag from "do we need read the
replacement definition?" to "do we need to check with the lookup table?"
the flag needs to be renamed later to something saner, e.g. "use_replace",
when the codebase is calmer, but not now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-15 15:23:33 -07:00
Junio C Hamano
4bbf5a2615 read_sha1_file(): get rid of read_sha1_file_repl() madness
Most callers want to silently get a replacement object, and they do not
care what the real name of the replacement object is.  Worse yet, no sane
interface to return the underlying object without replacement is provided.

Remove the function and make only the few callers that want the name of
the replacement object find it themselves.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-15 15:23:33 -07:00
Junio C Hamano
abb25ac365 t6050: make sure we test not just commit replacement
The replacement mechanism should affect all types of objects not
just commits, so make sure it deals with at least a blob.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-15 15:23:32 -07:00
Junio C Hamano
fea33a1ef3 Declare lookup_replace_object() in cache.h, not in commit.h
The declaration is misplaced as the replace API is supposed to affect
not just commits, but all types of objects.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-15 15:23:31 -07:00
Junio C Hamano
2f80de956f Merge branch 'maint'
* maint:
  add, merge, diff: do not use strcasecmp to compare config variable names
2011-05-14 20:44:09 -07:00
Ævar Arnfjörð Bjarmason
adc3b2b276 Makefile: add xgettext target for *.sh files
Change the "pot" target to also extract strings from our $(SCRIPT_SH)
files with xgettext(1).

Note that due to Jonathan Nieder's trick of doing "mv $@+ $@" at the
end of the target the "pot" target will now warn:

    $ make pot
        XGETTEXT po/git.pot
    po/git.pot+: warning: Charset "CHARSET" is not a portable encoding name.
                          Message conversion to user's charset might not work.

This warnings is emitted because xgettext is writing into a non-*.pot
file, it's harmless however. The content that's written out is
equivalent to what it would be if we were writing directly into an
existing POT file with --join-existing.

As part of this change I've eliminated the && chain between xgettext
calls, this is incompatible with $(QUIET_XGETTEXT), if the && is left
in it'll emit:

    /bin/sh: @echo: not found

Since it's redundant (the Makefile will stop if there's an error) I've
removed it altogether.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-14 20:29:11 -07:00
Ævar Arnfjörð Bjarmason
64a4295147 git-sh-i18n.sh: add GIT_GETTEXT_POISON support
Change git-sh-i18n.sh to support the GIT_GETTEXT_POISON environment
variable like gettext.c does, this ensures that tests that use
git-sh-i18n.sh will fail under GETTEXT_POISON=YesPlease if they rely
on Git's C locale messages without declaring that they do.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-14 20:29:11 -07:00
Ævar Arnfjörð Bjarmason
e00cf070a4 git-sh-i18n.sh: add no-op gettext() and eval_gettext() wrappers
Add a no-op wrapper library for Git's shell scripts. To split up the
gettext series I'm first submitting patches to gettextize the source
tree before I add any of the Makefile and Shell library changes needed
to actually use them.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-14 20:29:11 -07:00
Ævar Arnfjörð Bjarmason
ba67aaf2d0 git-sh-i18n--envsubst: our own envsubst(1) for eval_gettext()
Add a git-sh-i18n--envsubst program which is a stripped-down version
of the GNU envsubst(1) program that comes with GNU gettext for use in
the eval_gettext() fallback.

We need a C helper program because implementing eval_gettext() purely
in shell turned out to be unworkable. Digging through the Git mailing
list archives will reveal two shell implementations of eval_gettext
that are almost good enough, but fail on an edge case which is tested
for in the tests which are part of this patch.

These are the modifications I made to envsubst.c as I turned it into
sh-i18n--envsubst.c:

 * Added our git-compat-util.h header for xrealloc() and friends.

 * Removed inclusion of gettext-specific headers.

 * Removed most of main() and replaced it with my own. The modified
   version only does option parsing for --variables. That's all it
   needs.

 * Modified error() invocations to use our error() instead of
   error(3).

 * Replaced the gettext XNMALLOC(n, size) macro with just
   xmalloc(n). Since XNMALLOC() only allocated char's.

 * Removed the string_list_destroy function. It's redundant (also in
   the upstream code).

 * Replaced the use of stdbool.h (a C99 header) by doing the following
   replacements on the code:

    * s/bool/unsigned short int/g
    * s/true/1/g
    * s/false/0/g

Reported-by: Johannes Sixt <j.sixt@viscovery.net>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-14 20:29:05 -07:00
Jonathan Nieder
8c2be75fe1 add, merge, diff: do not use strcasecmp to compare config variable names
The config machinery already makes section and variable names
lowercase when parsing them, so using strcasecmp for comparison just
feels wasteful.  No noticeable change intended.

Noticed-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-14 18:53:39 -07:00
Jens Lehmann
d4e98b581b Submodules: Don't parse .gitmodules when it contains, merge conflicts
Commands like "git status", "git diff" and "git fetch" would fail when the
.gitmodules file contained merge conflicts because the config parser would
call die() when hitting the conflict markers:

    "fatal: bad config file line <n> in <path>/.gitmodules"

While this behavior was on the safe side, it is really unhelpful to the
user to have commands like status and diff fail, as these are needed to
find out what's going on. And the error message is only mildly helpful,
as it points to the right file but doesn't mention that it is unmerged.
Users of git gui were not shown any conflicts at all when this happened.

Improve the situation by checking if the index records .gitmodules as
unmerged. When that is the case we can't make any assumptions about the
configuration to be found there after the merge conflict is resolved by
the user, so assume that all recursion is disabled unless .git/config or
the global config say otherwise.

As soon as the merge conflict is resolved and the .gitmodules file has
been staged subsequent commands again honor any configuration done there.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-14 10:57:56 -07:00
Heiko Voigt
44ca0c8ed9 test that git status works with merge conflict in, .gitmodules
For example: Two users independently adding a submodule will result in a
merge conflict in .gitmodules. Since configuration of the status and
diff machinery depends on the file being parseable they currently
fail to produce useable output in case .gitmodules is marked with a
merge conflict.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-14 10:57:51 -07:00
Junio C Hamano
4dd1fbc7b1 Bigfile: teach "git add" to send a large file straight to a pack
When adding a new content to the repository, we have always slurped
the blob in its entirety in-core first, and computed the object name
and compressed it into a loose object file.  Handling large binary
files (e.g.  video and audio asset for games) has been problematic
because of this design.

At the middle level of "git add" callchain is an internal API
index_fd() that takes an open file descriptor to read from the
working tree file being added with its size. Teach it to call out to
fast-import when adding a large blob.

The write-out codepath in entry.c::write_entry() should be taught to
stream, instead of reading everything in core. This should not be so
hard to implement, especially if we limit ourselves only to loose
object files and non-delta representation in packfiles.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-13 16:11:18 -07:00
Luke Diamand
848de9c383 git-p4: warn if git authorship won't be retained
If the git commits you are submitting contain changes made by
other people, the authorship will not be retained. Change git-p4
to warn of this and to note that --preserve-user can be used
to solve the problem (if you have suitable permissions).
The warning can be disabled.

Add a test case and update documentation.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-13 12:59:13 -07:00
Junio C Hamano
2de58b398b Update draft release notes to 1.7.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-13 11:14:07 -07:00
Junio C Hamano
e4ae6efb78 Merge branch 'bf/commit-template-no-cleanup'
* bf/commit-template-no-cleanup:
  Do not strip empty lines / trailing spaces from a commit message template
2011-05-13 11:03:08 -07:00
Junio C Hamano
d6ad4ff120 Merge branch 'jc/t1506-shell-param-expansion-gotcha'
* jc/t1506-shell-param-expansion-gotcha:
  t1507: avoid "${parameter<op>'word'}" inside double-quotes
2011-05-13 11:02:47 -07:00
Junio C Hamano
ad29f71d53 Merge branch 'rr/rerere-libify-clear-gc'
* rr/rerere-libify-clear-gc:
  rerere: libify rerere_clear() and rerere_gc()
2011-05-13 11:02:40 -07:00
Junio C Hamano
e9c1a3a426 Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix'
* js/maint-send-pack-stateless-rpc-deadlock-fix:
  send-pack: unbreak push over stateless rpc
  send-pack: avoid deadlock when pack-object dies early
2011-05-13 11:02:29 -07:00
Junio C Hamano
df54e2bfd6 Merge branch 'jh/dirstat-lines'
* jh/dirstat-lines:
  Mark dirstat error messages for translation
  Improve error handling when parsing dirstat parameters
  New --dirstat=lines mode, doing dirstat analysis based on diffstat
  Allow specifying --dirstat cut-off percentage as a floating point number
  Add config variable for specifying default --dirstat behavior
  Refactor --dirstat parsing; deprecate --cumulative and --dirstat-by-file
  Make --dirstat=0 output directories that contribute < 0.1% of changes
  Add several testcases for --dirstat and friends
2011-05-13 11:01:32 -07:00
Junio C Hamano
f7d59e2568 Merge branch 'jc/fix-add-u-unmerged'
* jc/fix-add-u-unmerged:
  Fix "add -u" that sometimes fails to resolve unmerged paths
2011-05-13 11:01:15 -07:00
Junio C Hamano
3e1a363b1f Merge branch 'jn/setup-revisions-glob-and-friends-passthru'
* jn/setup-revisions-glob-and-friends-passthru:
  revisions: allow --glob and friends in parse_options-enabled commands
  revisions: split out handle_revision_pseudo_opt function
2011-05-13 11:00:25 -07:00
Junio C Hamano
2f3e3f573d Merge branch 'cn/log-parse-opt'
* cn/log-parse-opt:
  log: convert to parse-options
2011-05-13 10:59:57 -07:00
Junio C Hamano
32341b9df5 Merge branch 'maint'
* maint:
  Prepare for 1.7.5.2
  t5400: Fix a couple of typos

Conflicts:
	RelNotes
2011-05-13 10:58:10 -07:00
Junio C Hamano
375f8a032e Prepare for 1.7.5.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-13 10:57:09 -07:00
Junio C Hamano
e31b018372 Merge branch 'aw/maint-rebase-i-p-no-ff' into maint
* aw/maint-rebase-i-p-no-ff:
  git-rebase--interactive.sh: preserve-merges fails on merges created with no-ff
2011-05-13 10:45:21 -07:00
Junio C Hamano
bc67ad8c37 Merge branch 'js/blame-parsename' into maint
* js/blame-parsename:
  t/annotate-tests: Use echo & cat instead of sed
  blame: tolerate bogus e-mail addresses a bit better
2011-05-13 10:45:00 -07:00
Junio C Hamano
978471dcce Merge branch 'gr/cvsimport-alternative-cvspass-location' into maint
* gr/cvsimport-alternative-cvspass-location:
  Look for password in both CVS and CVSNT password files.
2011-05-13 10:44:54 -07:00
Junio C Hamano
e82c74618b Merge branch 'cj/p4merge' into maint
* cj/p4merge:
  Pass empty file to p4merge where no base is suitable.
2011-05-13 10:44:46 -07:00
Junio C Hamano
8272bcabac Merge branch 'jk/merge-one-file-working-tree' into maint
* jk/merge-one-file-working-tree:
  merge-one-file: fix broken merges with alternate work trees
  add tests for merge-index / merge-one-file
2011-05-13 10:44:19 -07:00
Junio C Hamano
a613b534bc Merge branch 'jc/fix-diff-files-unmerged' into maint
* jc/fix-diff-files-unmerged:
  diff-files: show unmerged entries correctly
  diff: remove often unused parameters from diff_unmerge()
  diff.c: return filepair from diff_unmerge()
  test: use $_z40 from test-lib
2011-05-13 10:41:54 -07:00
Junio C Hamano
4bdbfb15b2 Merge branch 'mz/maint-rename-unmerged' into maint
* mz/maint-rename-unmerged:
  diffcore-rename: don't consider unmerged path as source
2011-05-13 10:41:24 -07:00
Johan Herland
ebe8621fd7 t5400: Fix a couple of typos
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-13 09:57:16 -07:00
Junio C Hamano
240fe0505f Merge branch 'nd/struct-pathspec'
* nd/struct-pathspec:
  Tweak t3102-ls-tree-wildcards to run on Windows
2011-05-12 22:36:41 -07:00
Johannes Sixt
145f86a009 Tweak t3102-ls-tree-wildcards to run on Windows
The test case fails on Windows, because "a*" is an invalid file name.
Therefore, use "a[a]" instead.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-12 22:35:47 -07:00
Johannes Sixt
650af7ae8b t3703: Skip tests using directory name ":" on Windows
":" is not allowed in file names on Windows. Detect this case and skip a
test if necessary.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-12 22:32:24 -07:00
Junio C Hamano
8f2d4b1934 Merge branch 'jc/maint-1.7.4-pathspec-stdin-and-cmdline'
Update the fix for 1.7.5 maintenance track.

* jc/maint-1.7.4-pathspec-stdin-and-cmdline:
  setup_revisions(): take pathspec from command line and --stdin correctly
2011-05-11 16:09:25 -07:00
Junio C Hamano
1b6d0ae588 Merge branch 'jc/maint-1.6.6-pathspec-stdin-and-cmdline'
Update the fix for 1.7.4 maintenance track.

* jc/maint-1.6.6-pathspec-stdin-and-cmdline:
  setup_revisions(): take pathspec from command line and --stdin correctly
2011-05-11 16:07:14 -07:00
Junio C Hamano
93e7d672fc revision.c: leave a note for "a lone :" enhancement
If we later add a command in the log family that by default limit
its operation to the current subdirectory, we would need to resurrect
the "a lone ':' on the command line means no pathspec whatsoever".

Now the codepath was cleaned up, we can do so in one place.  Leave a
note to mark where it is for later generations.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-11 15:23:25 -07:00
Junio C Hamano
25197ebe7f Merge branch 'jc/maint-1.6.6-pathspec-stdin-and-cmdline'
* jc/maint-1.6.6-pathspec-stdin-and-cmdline:
  setup_revisions(): take pathspec from command line and --stdin correctly
2011-05-11 15:14:13 -07:00
Junio C Hamano
2d83abd4b2 Merge branch 'jc/maint-1.6.6-pathspec-stdin-and-cmdline'
Update the fix for 1.7.4 maintenance track.

* jc/maint-1.6.6-pathspec-stdin-and-cmdline:
  setup_revisions(): take pathspec from command line and --stdin correctly
2011-05-11 14:57:45 -07:00