git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git diff: support "-U" and "--unified" options properly

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
May 14, 2006, 12:57 UTC
Message-ID
<200605141457.17314.Josef.Weidendorfer@gmx.de>
In-Reply-To
<7vpsihsjq6.fsf@assigned-by-dhcp.cox.net>
On Saturday 13 May 2006 23:22, you wrote:
>  * remotes/ information from .git/config (js/fetchconfig)
> ...
>    [branch "master"]
> 	remote = "ko-private"

Why is this line needed? In this example, what is the relationship of local "master" with the remote? I think it is enough to specify the local upstream branch:

 [branch "master"]
    origin = "ko-master"

For the default pull action when on "master", we would have to look up for remotes with a fetch line fetching into "ko-master", which could be cumbersome. Besides, the fetch lines specify default actions when fetching from a given remote, and there is no garantuee that we want fetching into "ko-master" as any default action.

So we need
 [branch "ko-master"]
    tracksremote = "master of ko-private"
This also would specify that we are not allowed to commit on "ko-master".
If we do not want to have a local tracking branch at all, we would have
 [branch "master"]
    origin = "master of ko-private"
or
 [branch "master"]
    origin = "master of kernel.org:/pub/scm/git/git.git"
For a default push action when on master, I would add
 [branch "master"]
    push = "master of ko-private"
or alternatively
 [branch "master"]
    push = "master of kernel.org:/pub/scm/git/git.git"
Show 6 quoted lines
> ...
>    [remote "ko"]
>    	url = "kernel.org:/pub/scm/git/git.git"
>       push = master:master
> ...
> 	fetch = master:ko-master

These specifications more or less are independent from the above, as it specifies the defaults when fetching/pushing to the specified remote.

Josef
PS: Patch pending...
Previous: Martin LanghoffNext: Junio C Hamano
Message 12 of 21 in “git diff: support "-U" and "--unified" options properly”
  1. Linus TorvaldsMay 13, 2006
  2. Junio C HamanoMay 13, 2006
  3. Junio C HamanoMay 13, 2006
  4. Linus TorvaldsMay 13, 2006
  5. Junio C HamanoMay 13, 2006
  6. Linus TorvaldsMay 13, 2006
  7. Junio C HamanoMay 15, 2006
  8. Linus TorvaldsMay 15, 2006
  9. Junio C HamanoMay 15, 2006
  10. Linus TorvaldsMay 15, 2006
  11. Martin LanghoffMay 14, 2006
  12. Josef WeidendorferMay 14, 2006
  13. Junio C HamanoMay 14, 2006
  14. Branch relationships (was:Re: git diff: support "-U" and "--unified" options properly)Josef Weidendorfer, May 14, 2006
  15. Junio C HamanoMay 14, 2006
  16. Josef WeidendorferMay 14, 2006
  17. Junio C HamanoMay 14, 2006
  18. Josef WeidendorferMay 14, 2006
  19. Junio C HamanoMay 14, 2006
  20. Josef WeidendorferMay 15, 2006
  21. Junio C HamanoMay 15, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.