Re: [PATCH 06/18] t5613: clarify "too deep" recursion tests

2016-10-04 Thread Jacob Keller
On Tue, Oct 4, 2016 at 2:49 PM, Jeff King <p...@peff.net> wrote: > On Tue, Oct 04, 2016 at 02:43:24PM -0700, Jacob Keller wrote: > >> > Hmm. Now I am puzzled, because I _did_ line up them specifically to make >> > this clear. I put the numbers under the &q

Re: [PATCH 13/18] fill_sha1_file: write "boring" characters

2016-10-04 Thread Jacob Keller
On Tue, Oct 4, 2016 at 2:46 PM, Junio C Hamano <gits...@pobox.com> wrote: > Jacob Keller <jacob.kel...@gmail.com> writes: > >> On Mon, Oct 3, 2016 at 1:35 PM, Jeff King <p...@peff.net> wrote: >>> This function forms a sha1 as "xx/...", but

Re: [PATCH 06/18] t5613: clarify "too deep" recursion tests

2016-10-04 Thread Jacob Keller
On Tue, Oct 4, 2016 at 1:55 PM, Jeff King <p...@peff.net> wrote: > On Tue, Oct 04, 2016 at 01:52:19PM -0700, Jacob Keller wrote: > >> >> >> > +# Note: These tests depend on the hard-coded value of 5 as "too >> >> >> > deep". We star

Re: [PATCH 06/18] t5613: clarify "too deep" recursion tests

2016-10-04 Thread Jacob Keller
On Tue, Oct 4, 2016 at 1:49 PM, Jeff King <p...@peff.net> wrote: > On Tue, Oct 04, 2016 at 01:44:23PM -0700, Jacob Keller wrote: > >> On Tue, Oct 4, 2016 at 6:48 AM, Jeff King <p...@peff.net> wrote: >> > On Mon, Oct 03, 2016 at 10:57:48PM -0700, Jacob Keller w

Re: [PATCH 06/18] t5613: clarify "too deep" recursion tests

2016-10-04 Thread Jacob Keller
On Tue, Oct 4, 2016 at 6:48 AM, Jeff King <p...@peff.net> wrote: > On Mon, Oct 03, 2016 at 10:57:48PM -0700, Jacob Keller wrote: > >> > diff --git a/t/t5613-info-alternate.sh b/t/t5613-info-alternate.sh >> > index 7bc1c3c..b393613 100755 >> > --- a/t/t5613-in

Re: [PATCH 08/18] link_alt_odb_entry: refactor string handling

2016-10-04 Thread Jacob Keller
On Tue, Oct 4, 2016 at 6:53 AM, Jeff King <p...@peff.net> wrote: > On Mon, Oct 03, 2016 at 11:05:42PM -0700, Jacob Keller wrote: > >> This definitely makes reading the following function much easier, >> though the diff is a bit funky. I think the end result is much &g

Re: [PATCH 04/18] t5613: whitespace/style cleanups

2016-10-04 Thread Jacob Keller
On Tue, Oct 4, 2016 at 6:47 AM, Jeff King <p...@peff.net> wrote: > On Mon, Oct 03, 2016 at 10:52:39PM -0700, Jacob Keller wrote: > >> On Mon, Oct 3, 2016 at 1:34 PM, Jeff King <p...@peff.net> wrote: >> > Our normal test style these days puts the opening quote of

Re: [PATCH 0/18] alternate object database cleanups

2016-10-04 Thread Jacob Keller
On Tue, Oct 4, 2016 at 6:41 AM, Jeff King <p...@peff.net> wrote: > On Mon, Oct 03, 2016 at 10:47:31PM -0700, Jacob Keller wrote: > >> > The number of patches is a little intimidating, but I tried hard to >> > break the refactoring down into a sequence of obvious

Re: [PATCH 18/18] alternates: use fspathcmp to detect duplicates

2016-10-04 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:36 PM, Jeff King wrote: > On a case-insensitive filesystem, we should realize that > "a/objects" and "A/objects" are the same path. We already > use fspathcmp() to check against the main object directory, > but until recently we couldn't use it for

Re: [PATCH 17/18] sha1_file: always allow relative paths to alternates

2016-10-04 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:36 PM, Jeff King wrote: > We recursively expand alternates repositories, so that if A > borrows from B which borrows from C, A can see all objects. > > For the root object database, we allow relative paths, so A > can point to B as "../B/objects". However,

Re: [PATCH 16/18] count-objects: report alternates via verbose mode

2016-10-04 Thread Jacob Keller
\On Mon, Oct 3, 2016 at 1:36 PM, Jeff King wrote: > There's no way to get the list of alternates that git > computes internally; our tests only infer it based on which > objects are available. In addition to testing, knowing this > list may be helpful for somebody debugging their

Re: [PATCH 15/18] fill_sha1_file: write into a strbuf

2016-10-04 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:36 PM, Jeff King wrote: > It's currently the responsibility of the caller to give > fill_sha1_file() enough bytes to write into, leading them to > manually compute the required lengths. Instead, let's just > write into a strbuf so that it's impossible to

Re: [PATCH 13/18] fill_sha1_file: write "boring" characters

2016-10-04 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:35 PM, Jeff King wrote: > This function forms a sha1 as "xx/...", but skips over > the slot for the slash rather than writing it, leaving it to > the caller to do so. It also does not bother to put in a > trailing NUL, even though every caller would

Re: [PATCH 12/18] alternates: use a separate scratch space

2016-10-04 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:35 PM, Jeff King wrote: > The alternate_object_database struct uses a single buffer > both for storing the path to the alternate, and as a scratch > buffer for forming object names. This is efficient (since > otherwise we'd end up storing the path twice),

Re: [PATCH 10/18] alternates: provide helper for allocating alternate

2016-10-04 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:35 PM, Jeff King wrote: > Allocating a struct alternate_object_database is tricky, as > we must over-allocate the buffer to provide scratch space, > and then put in particular '/' and NUL markers. > > Let's encapsulate this in a function so that the

Re: [PATCH 09/18] alternates: provide helper for adding to alternates list

2016-10-04 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:35 PM, Jeff King wrote: > The submodule code wants to temporarily add an alternate > object store to our in-memory alt_odb list, but does it > manually. Let's provide a helper so it can reuse the code in > link_alt_odb_entry(). > > While we're adding our

Re: [PATCH 08/18] link_alt_odb_entry: refactor string handling

2016-10-04 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:34 PM, Jeff King wrote: > The string handling in link_alt_odb_entry() is mostly an > artifact of the original version, which took the path as a > ptr/len combo, and did not have a NUL-terminated string > until we created one in the alternate_object_database

Re: [PATCH 07/18] link_alt_odb_entry: handle normalize_path errors

2016-10-04 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:34 PM, Jeff King wrote: > When we add a new alternate to the list, we try to normalize > out any redundant "..", etc. However, we do not look at the > return value of normalize_path_copy(), and will happily > continue with a path that could not be

Re: [PATCH 06/18] t5613: clarify "too deep" recursion tests

2016-10-03 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:34 PM, Jeff King wrote: > These tests are just trying to show that we allow recursion > up to a certain depth, but not past it. But the counting is > a bit non-intuitive, and rather than test at the edge of the > breakage, we test "OK" cases in the middle

Re: [PATCH 05/18] t5613: do not chdir in main process

2016-10-03 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:34 PM, Jeff King wrote: > Our usual style when working with subdirectories is to chdir > inside a subshell or to use "git -C", which means we do not > have to constantly return to the main test directory. Let's > convert this old test, which does not follow

Re: [PATCH 04/18] t5613: whitespace/style cleanups

2016-10-03 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:34 PM, Jeff King wrote: > Our normal test style these days puts the opening quote of > the body on the description line, and indents the body with > a single tab. This ancient test did not follow this. > I was surprised you didn't do this first, but it

Re: [PATCH 03/18] t5613: use test_must_fail

2016-10-03 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:34 PM, Jeff King wrote: > Besides being our normal style, this correctly checks for an > error exit() versus signal death. > Another very simple but obvious improvement. Regards, Jake > Signed-off-by: Jeff King > --- >

Re: [PATCH 02/18] t5613: drop test_valid_repo function

2016-10-03 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:33 PM, Jeff King wrote: > This function makes sure that "git fsck" does not report any > errors. But "--full" has been the default since f29cd39 > (fsck: default to "git fsck --full", 2009-10-20), and we can > use the exit code (instead of counting the

Re: [PATCH 01/18] t5613: drop reachable_via function

2016-10-03 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:33 PM, Jeff King wrote: > This function was never used since its inception in dd05ea1 > (test case for transitive info/alternates, 2006-05-07). > Which is just as well, since it mutates the repo state in a > way that would invalidate further tests, without

Re: [PATCH 0/18] alternate object database cleanups

2016-10-03 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:33 PM, Jeff King wrote: > This series is the result of René nerd-sniping me with the claim that we > could "easily" teach count-objects to print out the list of alternates > in: > > http://public-inbox.org/git/c27dc1a4-3c7a-2866-d9d8-f5d3eb161...@web.de/

Re: [PATCH 1/5] pretty: allow formatting DATE_SHORT

2016-09-30 Thread Jacob Keller
On Fri, Sep 30, 2016 at 3:56 AM, SZEDER Gábor wrote: >> On Thu, Sep 29, 2016 at 1:33 AM, Jeff King wrote: >> > There's no way to do this short of "%ad" and --date=short, >> > but that limits you to having a single date format in the >> > output. >> > >> > This

Re: [PATCH 1/5] pretty: allow formatting DATE_SHORT

2016-09-30 Thread Jacob Keller
On Thu, Sep 29, 2016 at 1:33 AM, Jeff King wrote: > There's no way to do this short of "%ad" and --date=short, > but that limits you to having a single date format in the > output. > > This would possibly be better done with something more like > "%ad(short)". > > Signed-off-by:

Re: [PATCH 10/10] get_short_sha1: list ambiguous objects on error

2016-09-29 Thread Jacob Keller
On Thu, Sep 29, 2016 at 10:19 AM, Junio C Hamano wrote: > Jeff King writes: >> - "cat-file --batch-check" can show you the sha1 and type, but it >> won't abbreviate sha1s, and it won't show you commit/tag information >> >> - "log --stdin --no-walk" will

Re: [PATCH 10/10] get_short_sha1: list ambiguous objects on error

2016-09-26 Thread Jacob Keller
On Mon, Sep 26, 2016 at 9:36 AM, Linus Torvalds wrote: > This looks very good to me, but I wonder if it couldn't be even more > aggressive. > > In particular, the only hashes that most people ever use in short form > are commit hashes. Those are the ones you'd use

Re: [PATCH v2] format-patch: Add --rfc for the common case of [RFC PATCH]

2016-09-20 Thread Jacob Keller
On Mon, Sep 19, 2016 at 6:37 PM, Jeff King wrote: > On Mon, Sep 19, 2016 at 04:40:22PM -0700, Josh Triplett wrote: > >> > - there are a non-trivial number of patches for other projects (JGIT, >> > EGIT, StGit, etc). This is somewhat unique to git, where we discuss >> > a

Re: [PATCH v2] format-patch: Add --rfc for the common case of [RFC PATCH]

2016-09-19 Thread Jacob Keller
On Mon, Sep 19, 2016 at 4:55 PM, Josh Triplett <j...@joshtriplett.org> wrote: > On Mon, Sep 19, 2016 at 04:46:06PM -0700, Jacob Keller wrote: >> On Mon, Sep 19, 2016 at 4:40 PM, Josh Triplett <j...@joshtriplett.org> wrote: >> > On Mon, Sep 19, 2016 at 04:

Re: [PATCH v2] format-patch: Add --rfc for the common case of [RFC PATCH]

2016-09-19 Thread Jacob Keller
On Mon, Sep 19, 2016 at 4:40 PM, Josh Triplett wrote: > On Mon, Sep 19, 2016 at 04:34:35PM -0700, Jeff King wrote: >> As far as your patch goes, I'd be OK with defining: >> >> --rfc:: >> Pretend as if `--subject-prefix='RFC PATCH'` was given. >> Would: Shorthand

Re: [PATCH v2] format-patch: Add --rfc for the common case of [RFC PATCH]

2016-09-19 Thread Jacob Keller
On Mon, Sep 19, 2016 at 4:34 PM, Jeff King wrote: > - there are a non-trivial number of patches for other projects (JGIT, > EGIT, StGit, etc). This is somewhat unique to git, where we discuss > a lot of related projects on the list. But I wonder if other > projects

Re: .git directory tree as tar-file

2016-09-19 Thread Jacob Keller
On Mon, Sep 19, 2016 at 1:31 PM, Martin Bammer wrote: > Hi, > > it would be nice to have an option to have a .git.tar instead of the .git > directory tree. This tree quickly gets very big and copy and compare actions > take very long. I've observed that even in small projects

Re: Switching branches not working in a cloned repo

2016-09-19 Thread Jacob Keller
On Mon, Sep 19, 2016 at 6:58 AM, Paul Williamson wrote: > Hi, > > We use git extensively on a number of repos. Recently, we have had a problem > with one of them. This repo has a 'web_dev' branch. For copies of the repo > cloned before a certain (recent but

Re: [wishlist?] make submodule commands robust to having non-submodule Subprojects

2016-09-16 Thread Jacob Keller
On Fri, Sep 16, 2016 at 7:11 AM, Heiko Voigt wrote: > How about just > >git submodule add > > ? I remember back in the days when I started with submodules thats the > way I imagined submodules would work: > > 1. clone the submodule into a directory > 2. git submodule add

Re: git commit -p with file arguments

2016-09-11 Thread Jacob Keller
On Sun, Sep 11, 2016 at 6:57 PM, Junio C Hamano wrote: > > You are excused ;-) > > In ancient days, "git commit " was to add the contents > from working tree files that match to what is already in > the index and create a commit from that state. This ran against the >

Re: git commit -p with file arguments

2016-09-11 Thread Jacob Keller
On Sun, Sep 11, 2016 at 2:50 PM, Junio C Hamano wrote: > Jakub Narębski writes: > >> I wonder, if git-commit is to acquire such feature, what would be the >> best interface. "git commit :0:./"? "git commit -o -p " >> (that is, "git commit --only --patch ")?

Re: [PATCH 2/3] t0001: work around the bug that reads config file before repo setup

2016-09-09 Thread Jacob Keller
On Fri, Sep 9, 2016 at 4:22 AM, Jeff King wrote: > If you're curious what the fix looks like, it's in: > > https://github.com/peff/git jk/config-repo-setup > > The actual fix is in the final patch, but it needed a lot of preparatory > work to avoid breaking various programs that

Re: git commit -p with file arguments

2016-09-09 Thread Jacob Keller
On Mon, Sep 5, 2016 at 2:08 PM, Christian Neukirchen wrote: > Hi, > > I noticed the following suprising behavior: > > % git --version > git version 2.10.0 > > % git add bar > % git status -s > A bar > M foo > > % git commit -p foo > [stage a hunk] > ... > # Explicit

Re: [PATCH 1/3] diff.c: use diff_options directly

2016-09-08 Thread Jacob Keller
On Wed, Sep 7, 2016 at 4:36 PM, Stefan Beller wrote: > The value of `ecbdata->opt` is accessible via the short variable `o` > already, so let's use that instead. > > Signed-off-by: Stefan Beller Seems reasonable. > --- > diff.c | 21

Re: [PATCH 3/3] patch-ids: use commit sha1 as patch-id for merge commits

2016-09-07 Thread Jacob Keller
On Wed, Sep 7, 2016 at 3:04 PM, Jeff King wrote: > The patch-ids code which powers "log --cherry-pick" doesn't > look at whether each commit is a merge or not. It just feeds > the commit's first parent to the diff, and ignores any > additional parents. > The subject here is

Re: [PATCH 1/3] patch-ids: turn off rename detection

2016-09-07 Thread Jacob Keller
On Wed, Sep 7, 2016 at 3:02 PM, Jeff King wrote: > The patch-id code may be running inside another porcelain > like "git log" or "git format-patch", and therefore may have > set diff_detect_rename_default, either via the diff-ui > config, or by default since 5404c11 (diff: activate

Re: [PATCH v3 0/8] Better heuristics make prettier diffs

2016-09-07 Thread Jacob Keller
On Wed, Sep 7, 2016 at 11:11 AM, Junio C Hamano wrote: > Michael Haggerty writes: > >> * In "blame: honor the diff heuristic options and config": >> >> * In v2, I suggested making `blame` honor all diff-related options. >> Junio explained why this

Re: [PATCHv3] diff.c: emit moved lines with a different color

2016-09-07 Thread Jacob Keller
On Wed, Sep 7, 2016 at 11:02 AM, Stefan Beller wrote: > On Wed, Sep 7, 2016 at 10:54 AM, Junio C Hamano wrote: >> Stefan Beller writes: >> >>> as we do not want to see dashes ('moved-old'), I think I'l go with >>> "movedfrom" and

Re: [PATCHv3] diff.c: emit moved lines with a different color

2016-09-06 Thread Jacob Keller
On Mon, Sep 5, 2016 at 7:20 PM, Stefan Beller wrote: >> If I understand, this is to ensure that we don't keep re-hashing each >> line right? > > No, this is to ensure we have the context sensitivity of one prior line. > > In the collection phase we look at each line of the

Re: [PATCHv3] diff.c: emit moved lines with a different color

2016-09-05 Thread Jacob Keller
On Sun, Sep 4, 2016 at 4:42 PM, Stefan Beller wrote: > When we color the diff, we'll mark moved lines with a different color. > Excellent idea. This is a very neat way to show extra information without cluttering the diff output. > This is achieved by doing a two passes

Re: [WIP PATCH v2] diff.c: emit moved lines with a different color

2016-09-05 Thread Jacob Keller
On Mon, Sep 5, 2016 at 11:57 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> diff --git a/Documentation/config.txt b/Documentation/config.txt >> index 0bcb679..f4f51c2 100644 >> --- a/Documentation/config.txt >> +++ b/Documentation/config.txt >>

Re: [RFC/PATCH 0/2] Color moved code differently

2016-09-04 Thread Jacob Keller
On Fri, Sep 2, 2016 at 8:31 PM, Stefan Beller wrote: > When moving code (e.g. a function is moved to another part of the file or > to a different file), the review process is different than reviewing new > code. When reviewing moved code we are only interested in the diff as >

[PATCH v12 0/8] submodule inline diff format

2016-08-31 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Hopefully the final revision here. I've squashed in the memory leak fix suggested by Stefan, and the suggested changes from Junio, including his re-worded commit messages. interdiff between v11 and v12 diff --git c/path.c w/path.c index 3dbc44

[PATCH v12 5/8] allow do_submodule_path to work even if submodule isn't checked out

2016-08-31 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Currently, do_submodule_path will attempt locating the .git directory by using read_gitfile on /.git. If this fails it just assumes the /.git is actually a git directory. This is good because it allows for handling submodules which were

[PATCH v12 4/8] diff: prepare for additional submodule formats

2016-08-31 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> A future patch will add a new format for displaying the difference of a submodule. Make it easier by changing how we store the current selected format. Replace the DIFF_OPT flag with an enumeration, as each format will be mutually exclusive. Sign

[PATCH v12 2/8] diff.c: remove output_prefix_length field

2016-08-31 Thread Jacob Keller
From: Junio C Hamano "diff/log --stat" has a logic that determines the display columns available for the diffstat part of the output and apportions it for pathnames and diffstat graph automatically. 5e71a84a (Add output_prefix_length to diff_options, 2012-04-16) added the

[PATCH v12 6/8] submodule: convert show_submodule_summary to use struct object_id *

2016-08-31 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Since we're going to be changing this function in a future patch, lets go ahead and convert this to use object_id now. Signed-off-by: Jacob Keller <jacob.kel...@gmail.com> Signed-off-by: Junio C Hamano <gits...@pobox.com> ---

[PATCH v12 7/8] submodule: refactor show_submodule_summary with helper function

2016-08-31 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> A future patch is going to add a new submodule diff format which displays an inline diff of the submodule changes. To make this easier, and to ensure that both submodule diff formats use the same initial header, factor out show_submodule_

[PATCH v12 3/8] graph: add support for --line-prefix on all graph-aware output

2016-08-31 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Add an extension to git-diff and git-log (and any other graph-aware displayable output) such that "--line-prefix=" will print the additional line-prefix on every line of output. To make this work, we have to fix a few bugs in the grap

[PATCH v12 8/8] diff: teach diff to display submodule difference with an inline diff

2016-08-31 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Teach git-diff and friends a new format for displaying the difference of a submodule. The new format is an inline diff of the contents of the submodule between the commit range of the update. This allows the user to see the actual code change

[PATCH v12 1/8] cache: add empty_tree_oid object and helper function

2016-08-31 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Similar to is_null_oid(), and is_empty_blob_sha1() add an empty_tree_oid along with helper function is_empty_tree_oid(). For completeness, also add an "is_empty_tree_sha1()", "is_empty_blob_sha1()", "is_empty_tre

Re: [PATCH v11 0/8] submodule inline diff format

2016-08-31 Thread Jacob Keller
On Wed, Aug 31, 2016 at 9:45 AM, Junio C Hamano <gits...@pobox.com> wrote: > Jacob Keller <jacob.e.kel...@intel.com> writes: > >>> We probably should release for the error case. I'll do that. I don't >>> believe do_submodule_path ensures that the

Re: What's cooking in git.git (Aug 2016, #08; Wed, 24)

2016-08-31 Thread Jacob Keller
>> - t7408: modernize style >> >> I spotted a last-minute bug in v5, which is not a very good sign >> (it shows that nobody is reviewing). Any more comments? >> >> > > Jacob Keller reviewed that series as announced in > > https://public-inbo

Re: [PATCHv5 8/8] clone: recursive and reference option triggers submodule alternates

2016-08-31 Thread Jacob Keller
On Tue, Aug 30, 2016 at 10:04 PM, Stefan Beller <sbel...@google.com> wrote: > On Wed, Aug 24, 2016 at 4:37 PM, Jacob Keller <jacob.kel...@gmail.com> wrote: > >> Yes that seems reasonable. >> >> Thanks, >> Jake > > I reviewed all your comments an

Re: git submodules implementation question

2016-08-30 Thread Jacob Keller
On Mon, Aug 29, 2016 at 11:09 PM, Jacob Keller <jacob.kel...@gmail.com> wrote: > On Mon, Aug 29, 2016 at 5:12 PM, Uma Srinivasan <usriniva...@twitter.com> > wrote: >> This is great! Thanks Jake. If you happen to have the patch ID it >> would be helpful. >> &

Re: git submodules implementation question

2016-08-30 Thread Jacob Keller
On Mon, Aug 29, 2016 at 5:12 PM, Uma Srinivasan wrote: > This is great! Thanks Jake. If you happen to have the patch ID it > would be helpful. > > Uma > http://public-inbox.org/git/1472236108.28343.5.ca...@intel.com/

Re: git submodules implementation question

2016-08-29 Thread Jacob Keller
On Mon, Aug 29, 2016 at 4:15 PM, Junio C Hamano wrote: > Uma Srinivasan writes: >> This fixes my issue but what do you think? Is this the right way to >> fix it? Is there a better way? > > I think we already have a helper function that does a lot

Re: Notation for current branch?

2016-08-29 Thread Jacob Keller
On Mon, Aug 29, 2016 at 12:49 PM, Junio C Hamano <gits...@pobox.com> wrote: > Jacob Keller <jacob.kel...@gmail.com> writes: > >>> What's wrong with simply using 'HEAD' for scripting? >> >> When you want to display the current branch to the user, e.g. when >

Re: Notation for current branch?

2016-08-29 Thread Jacob Keller
On Sun, Aug 28, 2016 at 6:56 AM, Jakub Narębski wrote: > W dniu 28.08.2016 o 12:51, Kevin Daudt pisze: >> On Sun, Aug 28, 2016 at 05:58:18PM +0800, ryenus wrote: > >>> I wonder if there's an easy to use notation to refer to the current branch? >>> which is expected be friendly

Re: Feature Request: Branch-Aware Submodules

2016-08-28 Thread Jacob Keller
On Fri, Aug 26, 2016 at 8:12 AM, Hedges Alexander wrote: >> On 25 Aug 2016, at 19:45, Stefan Beller wrote: >> [1] https://github.com/jlehmann/git-submod-enhancements >> which has some attempts for checkout including the submodules. >> I also tried

Re: [PATCH 2/2] SubmittingPatches: hint at gitk's "Copy commit summary" command

2016-08-26 Thread Jacob Keller
On Fri, Aug 26, 2016 at 11:27 AM, Junio C Hamano wrote: > Beat Bolli writes: > >> @@ -124,7 +124,8 @@ archive, summarize the relevant points of the discussion. >> If you want to reference a previous commit in the history of a stable >> branch use the

Re: [PATCH v11 0/8] submodule inline diff format

2016-08-26 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> > On Fri, Aug 26, 2016 at 1:04 PM, Jeff King <p...@peff.net> wrote: > > On Fri, Aug 26, 2016 at 07:58:07PM +, Keller, Jacob E wrote: > > > >> > > char *git_pathdup_s

Re: [PATCH v11 0/8] submodule inline diff format

2016-08-26 Thread Jacob Keller
On Fri, Aug 26, 2016 at 1:04 PM, Jeff King wrote: > On Fri, Aug 26, 2016 at 07:58:07PM +, Keller, Jacob E wrote: > >> > > char *git_pathdup_submodule(const char *path, const char *fmt, >> > > ...) >> > > { >> > > + int err; >> > > va_list args; >> > >

Re: [PATCH v1 0/3] Update eol documentation

2016-08-25 Thread Jacob Keller
On Thu, Aug 25, 2016 at 1:31 PM, Junio C Hamano wrote: > tbo...@web.de writes: > >> From: Torsten Bögershausen >> >> Sorry for posting this so late: >> While reviewing another patch I realized that the eol related >> documentation was not updated as it should

Re: [PATCH v6 06/13] pkt-line: add functions to read/write flush terminated packet streams

2016-08-25 Thread Jacob Keller
On Thu, Aug 25, 2016 at 3:31 PM, Junio C Hamano wrote: > What is wrong about that? 4*80k = 320kB overhead for length fields > to transfer 5GB worth of data? I do not think it is worth worrying > about it. > > But I am more surprised by seeing that "why not a single huge >

[PATCH v11 0/8] submodule inline diff format

2016-08-25 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Modify the changes to do_submodule_path so that we properly call gitmodules_config() before the lookup of submodule_from_path. This may need to be modified so that we only call it the first time as I'm not sure what sort of performance hit we'

[PATCH v11 1/8] cache: add empty_tree_oid object and helper function

2016-08-25 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Similar to is_null_oid(), and is_empty_blob_sha1() add an empty_tree_oid along with helper function is_empty_tree_oid(). For completeness, also add an "is_empty_tree_sha1()", "is_empty_blob_sha1()", "is_empty_tre

[PATCH v11 8/8] diff: teach diff to display submodule difference with an inline diff

2016-08-25 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Teach git-diff and friends a new format for displaying the difference of a submodule. The new format is an inline diff of the contents of the submodule between the commit range of the update. This allows the user to see the actual code change

[PATCH v11 7/8] submodule: refactor show_submodule_summary with helper function

2016-08-25 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> A future patch is going to add a new submodule diff format which displays an inline diff of the submodule changes. To make this easier, and to ensure that both submodule diff formats use the same initial header, factor out show_submodule_

[PATCH v11 6/8] submodule: convert show_submodule_summary to use struct object_id *

2016-08-25 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Since we're going to be changing this function in a future patch, lets go ahead and convert this to use object_id now. Signed-off-by: Jacob Keller <jacob.kel...@gmail.com> --- diff.c | 2 +- submodule.c | 16 subm

[PATCH v11 3/8] graph: add support for --line-prefix on all graph-aware output

2016-08-25 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Add an extension to git-diff and git-log (and any other graph-aware displayable output) such that "--line-prefix=" will print the additional line-prefix on every line of output. To make this work, we have to fix a few bugs in the grap

[PATCH v11 4/8] diff: prepare for additional submodule formats

2016-08-25 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> A future patch will add a new format for displaying the difference of a submodule. Make it easier by changing how we store the current selected format. Replace the DIFF_OPT flag with an enumeration, as each format will be mutually exclusive. Sign

[PATCH v11 5/8] allow do_submodule_path to work even if submodule isn't checked out

2016-08-25 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Currently, do_submodule_path will attempt locating the .git directory by using read_gitfile on /.git. If this fails it just assumes the /.git is actually a git directory. This is good because it allows for handling submodules which were

[PATCH v11 2/8] diff.c: remove output_prefix_length field

2016-08-25 Thread Jacob Keller
From: Junio C Hamano "diff/log --stat" has a logic that determines the display columns available for the diffstat part of the output and apportions it for pathnames and diffstat graph automatically. 5e71a84a (Add output_prefix_length to diff_options, 2012-04-16) added the

Re: [PATCH v10 0/9] submodule inline diff format

2016-08-25 Thread Jacob Keller
On Thu, Aug 25, 2016 at 3:38 PM, Junio C Hamano <gits...@pobox.com> wrote: > Jacob Keller <jacob.kel...@gmail.com> writes: > >> So we should support the gitlink to a repository stored at >> without stuff inside the .git/modules, and we should support submo

Re: [PATCH v10 0/9] submodule inline diff format

2016-08-25 Thread Jacob Keller
On Thu, Aug 25, 2016 at 1:46 PM, Stefan Beller <sbel...@google.com> wrote: > On Thu, Aug 25, 2016 at 1:39 PM, Jacob Keller <jacob.kel...@gmail.com> wrote: >> On Tue, Aug 23, 2016 at 10:47 AM, Stefan Beller <sbel...@google.com> wrote: >>> On Tue, Aug 23, 20

Re: [PATCH v10 0/9] submodule inline diff format

2016-08-25 Thread Jacob Keller
On Tue, Aug 23, 2016 at 10:47 AM, Stefan Beller wrote: > On Tue, Aug 23, 2016 at 10:25 AM, Junio C Hamano wrote: >> I am not so sure about that. If there is an existing place that is >> buggy, shouldn't we fix that, instead of spreading the same bug >>

Re: [PATCH v10 0/9] submodule inline diff format

2016-08-25 Thread Jacob Keller
On Tue, Aug 23, 2016 at 10:25 AM, Junio C Hamano wrote: > I am not so sure about that. If there is an existing place that is > buggy, shouldn't we fix that, instead of spreading the same bug > (assuming that it is a bug in the first place, which I do not have a > strong

Re: [PATCHv5 8/8] clone: recursive and reference option triggers submodule alternates

2016-08-24 Thread Jacob Keller
On Wed, Aug 24, 2016 at 3:52 PM, Stefan Beller <sbel...@google.com> wrote: > On Tue, Aug 23, 2016 at 11:29 PM, Jacob Keller <jacob.kel...@gmail.com> wrote: >> On Tue, Aug 23, 2016 at 4:03 PM, Stefan Beller <sbel...@google.com> wrote: >>>>

Re: diff using 3-dot behavior

2016-08-24 Thread Jacob Keller
On Wed, Aug 24, 2016 at 9:22 AM, Junio C Hamano wrote: > The merge-base is to compute the point you forked your topic from > the mainline. So if you want to compare your current state in the > index with the fork point, you'd do > > git diff --cached $(git merge-base

Re: [PATCHv5 8/8] clone: recursive and reference option triggers submodule alternates

2016-08-24 Thread Jacob Keller
On Tue, Aug 23, 2016 at 4:03 PM, Stefan Beller wrote: >>> + >>> + if (option_recursive) { >>> + if (option_required_reference.nr && >>> + option_optional_reference.nr) >>> + die(_("clone --recursive is not compatible

Re: [PATCH v10 8/9] submodule: refactor show_submodule_summary with helper function

2016-08-24 Thread Jacob Keller
On Tue, Aug 23, 2016 at 4:07 PM, Junio C Hamano <gits...@pobox.com> wrote: > Jacob Keller <jacob.e.kel...@intel.com> writes: > >> From: Jacob Keller <jacob.kel...@gmail.com> >> >> A future patch is going to add a new submodule diff format which >>

Re: [PATCHv5 8/8] clone: recursive and reference option triggers submodule alternates

2016-08-23 Thread Jacob Keller
On Mon, Aug 15, 2016 at 2:53 PM, Stefan Beller wrote: > When `--recursive` and `--reference` is given, it is reasonable to > expect that the submodules are created with references to the submodules > of the given alternate for the superproject. > > An initial attempt to do

[PATCH v3] format-patch: show 0/1 and 1/1 for singleton patch with cover letter

2016-08-23 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Change the default behavior of git-format-patch to generate numbered sequence of 0/1 and 1/1 when generating both a cover-letter and a single patch. This standardizes the cover letter to have 0/N which helps distinguish the cover letter from the

Re: [PATCH v2] format-patch: show 0/1 and 1/1 for singleton patch with cover letter

2016-08-23 Thread Jacob Keller
On Tue, Aug 23, 2016 at 3:34 PM, Junio C Hamano <gits...@pobox.com> wrote: > Jacob Keller <jacob.e.kel...@intel.com> writes: > >> diff --git a/builtin/log.c b/builtin/log.c >> index 92dc34dcb0cc..49aa534f4a01 100644 >> --- a/builtin/log.c >> +++ b/bu

Re: [PATCHv5 6/8] clone: clarify option_reference as required

2016-08-23 Thread Jacob Keller
On Mon, Aug 15, 2016 at 2:53 PM, Stefan Beller wrote: > In the next patch we introduce optional references; To better distinguish > between optional and required references we rename the variable. > Makes sense. It's a bit weird to process "option_required_reference" but I

Re: [PATCHv5 7/8] clone: implement optional references

2016-08-23 Thread Jacob Keller
On Mon, Aug 15, 2016 at 2:53 PM, Stefan Beller wrote: > In a later patch we want to try to create alternates for submodules, > but they might not exist in the referenced superproject. So add a way > to skip the non existing references and report them. > Seems pretty straight

Re: [PATCHv5 4/8] submodule--helper update-clone: allow multiple references

2016-08-23 Thread Jacob Keller
On Mon, Aug 15, 2016 at 2:53 PM, Stefan Beller wrote: > Allow the user to pass in multiple references to update_clone. > Currently this is only internal API, but once the shell script is > replaced by a C version, this is needed. > > This fixes an API bug between the shell

Re: [PATCHv5 5/8] clone: factor out checking for an alternate path

2016-08-23 Thread Jacob Keller
On Mon, Aug 15, 2016 at 2:53 PM, Stefan Beller wrote: > + if (!repo && is_directory(mkpath("%s/.git/objects", ref_git))) { > + char *ref_git_git = mkpathdup("%s/.git", ref_git); > + free(ref_git); > + ref_git = ref_git_git; > +

Re: [PATCHv5 2/8] t7408: merge short tests, factor out testing method

2016-08-23 Thread Jacob Keller
On Mon, Aug 15, 2016 at 2:53 PM, Stefan Beller wrote: > Tests consisting of one line each can be consolidated to have fewer tests > to run as well as fewer lines of code. > > When having just a few git commands, do not create a new shell but > use the -C flag in Git to execute

Re: [PATCHv5 3/8] submodule--helper module-clone: allow multiple references

2016-08-23 Thread Jacob Keller
On Mon, Aug 15, 2016 at 2:53 PM, Stefan Beller wrote: > Allow users to pass in multiple references, just as clone accepts multiple > references as well. > Straight forward and reasonable change. Regards, Jake -- To unsubscribe from this list: send the line "unsubscribe git"

Re: [PATCHv5 1/8] t7408: modernize style

2016-08-23 Thread Jacob Keller
On Mon, Aug 15, 2016 at 2:53 PM, Stefan Beller wrote: > No functional change intended. This commit only changes formatting > to the style we recently use, e.g. starting the body of a test with a > single quote on the same line as the header, and then having the test > indented

[PATCH v2] format-patch: show 0/1 and 1/1 for singleton patch with cover letter

2016-08-23 Thread Jacob Keller
From: Jacob Keller <jacob.kel...@gmail.com> Change the default behavior of git-format-patch to generate numbered sequence of 0/1 and 1/1 when generating both a cover-letter and a single patch. This standardizes the cover letter to have 0/N which helps distinguish the cover letter from the

<    1   2   3   4   5   6   7   8   9   10   >