This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-30
Channels
- # aws (4)
- # beginners (143)
- # boot (37)
- # cider (31)
- # cljs-dev (53)
- # clojure (303)
- # clojure-conj (5)
- # clojure-dev (106)
- # clojure-dusseldorf (2)
- # clojure-greece (3)
- # clojure-italy (23)
- # clojure-spec (83)
- # clojure-uk (7)
- # clojurescript (328)
- # core-async (25)
- # cursive (2)
- # datascript (2)
- # datomic (3)
- # emacs (10)
- # hoplon (1)
- # jobs (2)
- # lein-figwheel (1)
- # leiningen (13)
- # luminus (6)
- # off-topic (38)
- # onyx (2)
- # parinfer (13)
- # pedestal (2)
- # portkey (5)
- # re-frame (11)
- # reagent (2)
- # shadow-cljs (61)
- # specter (6)
- # unrepl (60)
- # vim (4)
How is one supposed to know whether a git commit message spans more than one line? With either CLI or GUI, I normally am shown just the first line:
so, a given commit may or may not include extensive rationale, but I cannot know that in a glance. Any known solution?
right, I see. that's not how the Git CLI expects commit messages to be used. you can read the subject lines at a glance, then if you need further context you open up a specific commit
@vemv git log
does show multi-line messages, including the extra lines. I think you have some customization going on.
@dominicm I want the customization so I'm able to quickly find relevant commits. At the same time I care about extended info
@vemv you can customize the format git log
shows: https://git-scm.com/docs/git-log#_commit_formatting
yeah, seems like you'd have to put git log --format="%h %s %b"
through awk or perl, detecting if the third column exists
multi-line search-and-replace appears to be a tricky problem, or at least my attempts failed miserably!
my idea was to emit git log --format="%h %s XXX%bXXX"
and then do a s/XXX.+XXX//
. But multi-lines replacing seems to work differently, as I see no replacement being performed
yeah I think sed can do multi-line editing, but is really optimised for single-line editing
https://unix.stackexchange.com/questions/26284/how-can-i-use-sed-to-replace-a-multi-line-string
seems like bit of a rabbit hole, since the XXX
delimiter will be repeated many times, so a 'good' replacement may swallow N commits
got it! it was a matter of "greedy" vs "lazy". Didn't know about the concept really http://ruby-doc.org/core-2.5.0/Regexp.html
nice! i haven't done any regex stuff for yonks, tho i vaguely remember about greedy/lazy. glad you got it sorted 🙂
not really an answer for this specifically but it reminded me I stole these from someone (add to your [alias] block in ~/.gitconfig):
lol = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lola = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative --all
lolas = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative --all --stat
I use git lol
all the day long